1 --- cups-1.1.14/filter/hpgl-input.c.orig 2002-01-02 18:58:57.000000000 +0100
2 +++ cups-1.1.14/filter/hpgl-input.c 2004-12-22 15:37:13.000000000 +0100
5 * HP-GL/2 input processing for the Common UNIX Printing System (CUPS).
7 - * Copyright 1993-2002 by Easy Software Products.
8 + * Copyright 1993-2004 by Easy Software Products.
10 * These coded instructions, statements, and computer programs are the
11 * property of Easy Software Products and are protected by Federal
13 * Attn: CUPS Licensing Information
14 * Easy Software Products
15 * 44141 Airport View Drive, Suite 204
16 - * Hollywood, Maryland 20636-3111 USA
17 + * Hollywood, Maryland 20636 USA
19 - * Voice: (301) 373-9603
20 + * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
25 ch, /* Current char */
26 done, /* Non-zero when the current command is read */
28 - char buf[262144]; /* String buffer */
29 + char buf[262144], /* String buffer */
30 + *bufptr; /* Pointer into buffer */
31 static param_t p[MAX_PARAMS]; /* Parameter buffer */
38 + case '%' : /* PJL command? */
39 + if (getc(fp) == '-')
42 + * Yes, dump everything up to the "ENTER LANGUAGE" line...
45 + while (fgets(buf, sizeof(buf), fp) != NULL)
46 + if (strstr(buf, "ENTER") && strstr(buf, "LANGUAGE"))
51 default : /* HP RTL/PCL control */
52 - while ((i = getc(fp)) != EOF && !isupper(i));
53 + while ((i = getc(fp)) != EOF && !isupper(i & 255));
56 - } while (ch == 0x1b);
63 if (strcasecmp(name, "LB") == 0)
65 - for (i = 0; (ch = getc(fp)) != StringTerminator; i ++)
69 + while ((ch = getc(fp)) != StringTerminator)
70 + if (bufptr < (buf + sizeof(buf) - 1))
74 p[num_params].type = PARAM_STRING;
75 p[num_params].value.string = strdup(buf);
79 else if (strcasecmp(name, "PE") == 0)
81 - for (i = 0; i < (sizeof(buf) - 1); i ++)
82 - if ((buf[i] = getc(fp)) == ';')
85 + while ((ch = getc(fp)) != ';')
86 + if (bufptr < (buf + sizeof(buf) - 1))
91 p[num_params].type = PARAM_STRING;
92 p[num_params].value.string = strdup(buf);