ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rtcontrib.c
(Generate patch)

Comparing ray/src/util/rtcontrib.c (file contents):
Revision 1.3 by greg, Thu May 26 15:14:42 2005 UTC vs.
Revision 1.4 by greg, Thu May 26 17:53:28 2005 UTC

# Line 5 | Line 5 | static const char RCSid[] = "$Id$";
5   * Gather rtrace output to compute contributions from particular sources
6   */
7  
8 + #include  "standard.h"
9   #include  <ctype.h>
9 #include  "rtio.h"
10 #include  "rterror.h"
10   #include  "platform.h"
11   #include  "rtprocess.h"
12   #include  "selcall.h"
# Line 562 | Line 561 | badspec:
561   int
562   getinp(char *buf, FILE *fp)
563   {
564 +        char    *cp;
565 +        int     i;
566 +
567          switch (inpfmt) {
568          case 'a':
569 <                if (fgets(buf, 128, fp) == NULL)
570 <                        return 0;
569 >                cp = buf;               /* make sure we get 6 floats */
570 >                for (i = 0; i < 6; i++) {
571 >                        if (fgetword(cp, buf+127-cp, fp) == NULL)
572 >                                return 0;
573 >                        if ((cp = fskip(cp)) == NULL || *cp)
574 >                                return 0;
575 >                        *cp++ = ' ';
576 >                }
577 >                getc(fp);               /* get/put eol */
578 >                *cp-- = '\0'; *cp = '\n';
579                  return strlen(buf);
580          case 'f':
581                  if (fread(buf, sizeof(float), 6, fp) < 6)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines