74 |
|
exit(1); |
75 |
|
} |
76 |
|
if (i == argc-2 && freopen(argv[i+1], "w", stdout) == NULL) { |
77 |
< |
fprintf(stderr, "can't open output \"%s\"\n", |
77 |
> |
fprintf(stderr, "%s: can't open output \"%s\"\n", |
78 |
|
progname, argv[i+1]); |
79 |
|
exit(1); |
80 |
|
} |
134 |
|
quiterr("out of memory in skel2ra"); |
135 |
|
/* convert image */ |
136 |
|
for (y = ymax-1; y >= 0; y--) { |
137 |
< |
scanout[x][RED] = getc(stdin); |
138 |
< |
scanout[x][GRN] = getc(stdin); |
139 |
< |
scanout[x][BLU] = getc(stdin); |
140 |
< |
if (feof(stdin) || ferror(stdin)) |
137 |
> |
for (x = 0; x < xmax; x++) { |
138 |
> |
scanout[x][RED] = getc(stdin); |
139 |
> |
scanout[x][GRN] = getc(stdin); |
140 |
> |
scanout[x][BLU] = getc(stdin); |
141 |
> |
} |
142 |
> |
if (feof(stdin) | ferror(stdin)) |
143 |
|
quiterr("error reading skel image"); |
144 |
|
/* undo gamma */ |
145 |
|
gambs_colrs(scanout, xmax); |