--- ray/src/px/ttyimage.c 1989/02/02 10:49:42 1.1 +++ ray/src/px/ttyimage.c 1989/09/12 13:04:41 1.2 @@ -50,8 +50,7 @@ char **argv; while (fgets(sbuf, sizeof(sbuf), input) != NULL && sbuf[0] != '\n') ; /* get picture dimensions */ - if (fgets(sbuf, sizeof(sbuf), input) == NULL || - sscanf(sbuf, "-Y %d +X %d\n", &yres, &xres) != 2) { + if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) { fprintf(stderr, "%s: bad picture size\n", progname); exit(1); }