--- ray/src/px/panim.c 2003/02/22 02:07:27 2.2 +++ ray/src/px/panim.c 2004/01/02 10:25:13 2.6 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: panim.c,v 2.2 2003/02/22 02:07:27 greg Exp $"; +static const char RCSid[] = "$Id: panim.c,v 2.6 2004/01/02 10:25:13 schorsch Exp $"; #endif /* * Send pictures to PC animation system. @@ -8,7 +8,9 @@ static const char RCSid[] = "$Id: panim.c,v 2.2 2003/0 */ #include +#include +#include "rtprocess.h" #include "random.h" #include "color.h" #include "clntrpc.h" @@ -16,7 +18,6 @@ static const char RCSid[] = "$Id: panim.c,v 2.2 2003/0 #define GAMMA 2.0 /* gamma correction factor */ -FILE *popen(); char *pcom = NULL; /* pipe command */ @@ -73,7 +74,7 @@ char *argv[]; sendframe(file) /* convert and send a frame */ char *file; { - char command[128]; + char command[PATH_MAX]; COLR scanin[SCANLINE]; int xres, yres; int xbeg, ybeg; @@ -89,7 +90,7 @@ char *file; file = ""; } else { if (pcom != NULL) { - sprintf(command, "( %s ) < %s", pcom, file); + sprintf(command, "( %s ) < \"%s\"", pcom, file); fp = popen(command, "r"); } else fp = fopen(file, "r"); @@ -99,7 +100,7 @@ char *file; exit(1); } /* get dimensions */ - getheader(fp, NULL); + getheader(fp, NULL, NULL); if (checkheader(fp, COLRFMT, NULL) < 0) { fputs(file, stderr); fputs(": not a Radiance picture\n", stderr); @@ -115,7 +116,7 @@ char *file; xbeg = (SCANLINE-xres)/2; ybeg = (NUMSCANS-yres)/2; /* clear output */ - bzero(sc_frame_arr, sizeof(sc_frame_arr)); + memset(sc_frame_arr, '\0', sizeof(sc_frame_arr)); /* get frame */ for (y = yres-1; y >= 0; y--) { if (freadcolrs(scanin, xres, fp) < 0) {