20 |
|
|
21 |
|
int nrows; /* number of rows output at once */ |
22 |
|
|
23 |
+ |
int wrongformat = 0; |
24 |
+ |
|
25 |
|
#define scanbar ((COLR *)buf) |
26 |
|
|
27 |
|
char *progname; |
30 |
|
headline(s) /* process line from header */ |
31 |
|
char *s; |
32 |
|
{ |
33 |
+ |
char fmt[32]; |
34 |
+ |
|
35 |
|
fputs(s, stdout); |
36 |
|
if (isaspect(s)) |
37 |
|
inpaspect *= aspectval(s); |
38 |
+ |
else if (isformat(s)) { |
39 |
+ |
formatval(fmt, s); |
40 |
+ |
wrongformat = strcmp(fmt, COLRFMT); |
41 |
+ |
} |
42 |
|
} |
43 |
|
|
44 |
|
|
63 |
|
exit(1); |
64 |
|
} |
65 |
|
/* transfer header */ |
66 |
< |
getheader(fin, headline); |
66 |
> |
getheader(fin, headline, NULL); |
67 |
> |
if (wrongformat) { |
68 |
> |
fprintf(stderr, "%s: wrong picture format\n", progname); |
69 |
> |
exit(1); |
70 |
> |
} |
71 |
|
/* add new header info. */ |
72 |
|
if (inpaspect < .99 || inpaspect > 1.01) |
73 |
|
fputaspect(1./inpaspect/inpaspect, stdout); |