276 |
|
int no_rows = 0; /* number of output rows */ |
277 |
|
|
278 |
|
/* check settings and assign defaults */ |
279 |
< |
static void |
279 |
> |
static int |
280 |
|
check_sizes() |
281 |
|
{ |
282 |
|
if (fmtid == NULL) { |
288 |
|
comp_size = sizeof(double); |
289 |
|
else if (!strcmp(fmtid, "byte")) |
290 |
|
comp_size = 1; |
291 |
+ |
else { |
292 |
+ |
fprintf(stderr, "Unsupported format: %s\n", fmtid); |
293 |
+ |
return(0); |
294 |
+ |
} |
295 |
|
} |
296 |
|
if (n_comp <= 0) |
297 |
|
n_comp = 3; |
298 |
+ |
return(1); |
299 |
|
} |
300 |
|
|
301 |
|
/* output transposed ASCII or binary data from memory */ |
578 |
|
if (i_header) { /* read header */ |
579 |
|
if (getheader(stdin, &headline, NULL) < 0) |
580 |
|
return(1); |
581 |
< |
check_sizes(); |
581 |
> |
if (!check_sizes()) |
582 |
> |
return(1); |
583 |
|
if (comp_size) { /* a little late... */ |
584 |
|
SET_FILE_BINARY(stdin); |
585 |
|
SET_FILE_BINARY(stdout); |
586 |
|
} |
587 |
< |
} else |
588 |
< |
check_sizes(); |
587 |
> |
} else if (!check_sizes()) |
588 |
> |
return(1); |
589 |
|
if (o_header) { /* write header */ |
590 |
|
printargs(argc, argv, stdout); |
591 |
|
if (transpose && (no_rows <= 0) & (no_columns <= 0)) { |