POV-Ray : Newsgroups : povray.advanced-users : #write(outfile,chr(0)) doesn't work. A bug? : Re: #write(outfile,chr(0)) doesn't work. A bug? Server Time
2 Nov 2024 11:23:28 EDT (-0400)
  Re: #write(outfile,chr(0)) doesn't work. A bug?  
From: Mark Wagner
Date: 23 Oct 1999 00:28:52
Message: <38113984@news.povray.org>
Gerald K. Dobiasovsky wrote in message <380f6e5d@news.povray.org>...
>BTW I found another bug in the above function.
>Try a string ending with '\\' either in a file write or in one of the
>console output streams:
>Most of the time one gets garbage appended to the string,
>because the pointer to the last character in the source string is
>incremented even if this character is the null-byte.


I found a fix for this bug (haven't been able to test it yet, though).

In Parse_Formatted_String in file express.c, replace the line
     while (*src != '\0')
with the line
     while (*dest != '\0')
and the line
          case '\0': *dest=0x5c; break;
with the line
          case '\0': *dest=0x5c; *(dest+1) = '\0'; break;
and increast the size of the 'buff' array to MAX_STRING_INDEX*2+1

This should solve the problem.

Mark


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.