269 |
|
cmin = atoi(argv[2]); |
270 |
|
nrows = atoi(argv[3]); |
271 |
|
ncols = atoi(argv[4]); |
272 |
< |
if ((rmin < 0) | (cmin < 0) | (nrows < 0) | (ncols < 0)) |
272 |
> |
if ((rmin < 0) | (cmin < 0)) |
273 |
|
goto usage; |
274 |
|
if (argc <= 5) |
275 |
|
SET_FILE_BINARY(fp); |
301 |
|
fputs(": missing input dimensions\n", stderr); |
302 |
|
return(1); |
303 |
|
} |
304 |
< |
if (!nrows) |
305 |
< |
nrows = numscans(&res) - rmin; |
306 |
< |
if (!ncols) |
307 |
< |
ncols = scanlen(&res) - cmin; |
304 |
> |
if (nrows <= 0 ) |
305 |
> |
nrows += numscans(&res) - rmin; |
306 |
> |
if (ncols <= 0) |
307 |
> |
ncols += scanlen(&res) - cmin; |
308 |
|
if ((nrows <= 0) | (ncols <= 0) | |
309 |
|
(rmin+nrows > numscans(&res)) | |
310 |
|
(cmin+ncols > scanlen(&res))) { |