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

Comparing ray/src/gen/loadEPW.c (file contents):
Revision 2.5 by greg, Wed Jun 4 17:48:48 2025 UTC vs.
Revision 2.6 by greg, Wed Jul 30 22:15:53 2025 UTC

# Line 295 | Line 295 | EPWopen(const char *fname)
295                  hdr->comments1 = (char *)malloc(n);
296                  if (hdr->comments1 == NULL)
297                          goto memerr;
298 <                memcpy(hdr->comments1, linbuf+11, n);
299 <                hdr->comments1[n] = '\0';
298 >                memcpy(hdr->comments1, linbuf+11, n-1);
299 >                hdr->comments1[n-1] = '\0';
300          }
301          if (!fgets(linbuf, sizeof(linbuf), hdr->fp))
302                  goto readerr;
# Line 308 | Line 308 | EPWopen(const char *fname)
308                  hdr->comments2 = (char *)malloc(n);
309                  if (hdr->comments2 == NULL)
310                          goto memerr;
311 <                memcpy(hdr->comments2, linbuf+11, n);
312 <                hdr->comments2[n] = '\0';
311 >                memcpy(hdr->comments2, linbuf+11, n-1);
312 >                hdr->comments2[n-1] = '\0';
313          }
314          if (!fgets(linbuf, sizeof(linbuf), hdr->fp))
315                  goto readerr;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines