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

Comparing ray/src/util/rfluxmtx.c (file contents):
Revision 2.47 by greg, Sun Mar 3 17:01:13 2019 UTC vs.
Revision 2.48 by greg, Mon Jul 29 22:52:39 2019 UTC

# Line 144 | Line 144 | oconv_command(int ac, char *av[])
144                  strcpy(cp, "-w- ");
145                  cp += 4;
146          }
147 <        while (ac-- > 0) {
148 <                strcpy(cp, *av++);
149 <                while (*cp) cp++;
150 <                *cp++ = ' ';
151 <                if (cp >= oconvbuf+(sizeof(oconvbuf)-32))
147 >        while (ac-- > 0) {      /* copy each argument */
148 >                int     len = strlen(*av);
149 >                if (cp+len+4 >= oconvbuf+sizeof(oconvbuf))
150                          goto overrun;
151 +                if (matchany(*av, SPECIALS)) {
152 +                        *cp++ = QUOTCHAR;
153 +                        strcpy(cp, *av++);
154 +                        cp += len;
155 +                        *cp++ = QUOTCHAR;
156 +                } else {
157 +                        strcpy(cp, *av++);
158 +                        cp += len;
159 +                }
160 +                *cp++ = ' ';
161          }
162                                  /* receiver goes last */
163          if (matchany(recv, SPECIALS)) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines