--- ray/src/px/protate.c 1989/02/02 10:49:27 1.1 +++ ray/src/px/protate.c 1990/01/18 23:58:15 1.3 @@ -50,13 +50,12 @@ char *argv[]; /* add new header info. */ printf("%s\n\n", progname); /* get picture size */ - if (fgets(buf, sizeof(buf), fin) == NULL || - sscanf(buf, "-Y %d +X %d\n", &yres, &xres) != 2) { + if (fgetresolu(&xres, &yres, fin) != (YMAJOR|YDECR)) { fprintf(stderr, "%s: bad picture size\n", progname); exit(1); } /* write new picture size */ - printf("-Y %d +X %d\n", xres, yres); + fputresolu(YMAJOR|YDECR, yres, xres, stdout); /* compute buffer capacity */ nrows = sizeof(buf)/sizeof(COLR)/yres; rotate(fin); /* rotate the image */ @@ -87,7 +86,8 @@ FILE *fp; exit(1); } for (inx = 0; inx < nrows && xoff+inx < xres; inx++) - bcopy(inline[xoff+inx], scanbar[inx*yres+iny], + bcopy((char *)inline[xoff+inx], + (char *)scanbar[inx*yres+iny], sizeof(COLR)); } for (inx = 0; inx < nrows && xoff+inx < xres; inx++)