1 --- ggv-1.0.2/src/ps.c.buffer Mon Jan 22 09:04:50 2001
2 +++ ggv-1.0.2/src/ps.c Tue Sep 24 23:10:14 2002
5 /* Jake Hamby patch 18/3/98 */
7 - sscanf(line, "%*s %s", text);
8 + sscanf(line, "%*s %256s", text);
9 /*doc->epsf = iscomment(text, "EPSF-");*/
10 doc->epsf = iscomment(text, "EPSF"); /* Hamby - This line changed */
11 doc->beginheader = position;
13 } else if (doc->date == NULL && iscomment(line+2, "CreationDate:")) {
14 doc->date = gettextline(line+length("%%CreationDate:"));
15 } else if (bb_set == NONE && iscomment(line+2, "BoundingBox:")) {
16 - sscanf(line+length("%%BoundingBox:"), "%s", text);
17 + sscanf(line+length("%%BoundingBox:"), "%256s", text);
18 if (strcmp(text, "(atend)") == 0) {
23 } else if (orientation_set == NONE &&
24 iscomment(line+2, "Orientation:")) {
25 - sscanf(line+length("%%Orientation:"), "%s", text);
26 + sscanf(line+length("%%Orientation:"), "%256s", text);
27 if (strcmp(text, "(atend)") == 0) {
28 orientation_set = ATEND;
29 } else if (strcmp(text, "Portrait") == 0) {
33 } else if (page_order_set == NONE && iscomment(line+2, "PageOrder:")) {
34 - sscanf(line+length("%%PageOrder:"), "%s", text);
35 + sscanf(line+length("%%PageOrder:"), "%256s", text);
36 if (strcmp(text, "(atend)") == 0) {
37 page_order_set = ATEND;
38 } else if (strcmp(text, "Ascend") == 0) {
42 } else if (pages_set == NONE && iscomment(line+2, "Pages:")) {
43 - sscanf(line+length("%%Pages:"), "%s", text);
44 + sscanf(line+length("%%Pages:"), "%256s", text);
45 if (strcmp(text, "(atend)") == 0) {
50 } else if (doc->default_page_orientation == NONE &&
51 iscomment(line+2, "PageOrientation:")) {
52 - sscanf(line+length("%%PageOrientation:"), "%s", text);
53 + sscanf(line+length("%%PageOrientation:"), "%256s", text);
54 if (strcmp(text, "Portrait") == 0) {
55 doc->default_page_orientation = PORTRAIT;
56 } else if (strcmp(text, "Landscape") == 0) {
59 } else if (doc->default_page_orientation == NONE &&
60 iscomment(line+2, "PageOrientation:")) {
61 - sscanf(line+length("%%PageOrientation:"), "%s", text);
62 + sscanf(line+length("%%PageOrientation:"), "%256s", text);
63 if (strcmp(text, "Portrait") == 0) {
64 doc->default_page_orientation = PORTRAIT;
65 } else if (strcmp(text, "Landscape") == 0) {
68 } else if (doc->pages[doc->numpages].orientation == NONE &&
69 iscomment(line+2, "PageOrientation:")) {
70 - sscanf(line+length("%%PageOrientation:"), "%s", text);
71 + sscanf(line+length("%%PageOrientation:"), "%256s", text);
72 if (strcmp(text, "Portrait") == 0) {
73 doc->pages[doc->numpages].orientation = PORTRAIT;
74 } else if (strcmp(text, "Landscape") == 0) {
77 } else if ((page_bb_set == NONE || page_bb_set == ATEND) &&
78 iscomment(line+2, "PageBoundingBox:")) {
79 - sscanf(line+length("%%PageBoundingBox:"), "%s", text);
80 + sscanf(line+length("%%PageBoundingBox:"), "%256s", text);
81 if (strcmp(text, "(atend)") == 0) {
86 } else if (orientation_set == ATEND &&
87 iscomment(line+2, "Orientation:")) {
88 - sscanf(line+length("%%Orientation:"), "%s", text);
89 + sscanf(line+length("%%Orientation:"), "%256s", text);
90 if (strcmp(text, "Portrait") == 0) {
91 doc->orientation = PORTRAIT;
92 } else if (strcmp(text, "Landscape") == 0) {
93 doc->orientation = LANDSCAPE;
95 } else if (page_order_set == ATEND && iscomment(line+2, "PageOrder:")) {
96 - sscanf(line+length("%%PageOrder:"), "%s", text);
97 + sscanf(line+length("%%PageOrder:"), "%256s", text);
98 if (strcmp(text, "Ascend") == 0) {
99 doc->pageorder = ASCEND;
100 } else if (strcmp(text, "Descend") == 0) {
101 @@ -1277,7 +1277,7 @@
102 else if IS_BEGIN("Data:") {
104 strcpy(save, line+7);
105 - if (sscanf(line+length("%%BeginData:"), "%d %*s %s", &num, text) >= 1) {
106 + if (sscanf(line+length("%%BeginData:"), "%d %*s %256s", &num, text) >= 1) {
107 if (strcmp(text, "Lines") == 0) {
108 for (i=0; i < num; i++) {
109 cp = fgets(line, size, fp);
110 @@ -1394,7 +1394,7 @@
111 } else if (iscomment(line+7, "Data:")) {
113 strcpy(save, line+7);
114 - if (sscanf(line+length("%%BeginData:"), "%d %*s %s", &num, text) >= 1) {
115 + if (sscanf(line+length("%%BeginData:"), "%d %*s %256s", &num, text) >= 1) {
116 if (strcmp(text, "Lines") == 0) {
117 for (i=0; i < num; i++) {
118 cp = fgets(line, size, fp);
119 @@ -1470,7 +1470,7 @@
120 } else if (iscomment(line+7, "Data:")) {
122 if (sscanf(line+length("%%BeginData:"),
123 - "%d %*s %s", &num, text) >= 1) {
124 + "%d %*s %256s", &num, text) >= 1) {
125 if (strcmp(text, "Lines") == 0) {
126 for (i=0; i < num; i++) {
127 fgets(line, sizeof line, from);
128 @@ -1538,7 +1538,7 @@
129 } else if (iscomment(line+7, "Data:")) {
131 if (sscanf(line+length("%%BeginData:"),
132 - "%d %*s %s", &num, text) >= 1) {
133 + "%d %*s %256s", &num, text) >= 1) {
134 if (strcmp(text, "Lines") == 0) {
135 for (i=0; i < num; i++) {
136 fgets(line, sizeof line, from);
137 @@ -1623,7 +1623,7 @@
141 - sscanf(comment+length("%%Pages:"), "%s", text);
142 + sscanf(comment+length("%%Pages:"), "%256s", text);
143 if (strcmp(text, "(atend)") == 0) {
144 fputs(comment, dest_file);