[physfs] lzma: strncpy for non-string data?
devurandom at gmx.net
Sun May 27 05:38:47 EDT 2007
Am Sonntag, 27. Mai 2007 schrieb Ryan C. Gordon:
> This is in lzma.c, around line 316...
> /* !!! FIXME: strncpy for non-string data? */
> (void*) (entry->archive->folder[entry->folderIndex].cache +
> entry->offset + entry->position),
> (size_t) wantedSize);
> ...is there any reason this can't be a memcpy()? If I'm reading this
> correctly, this will copy the wrong amount of data if it reads a binary
> file with an embedded zero.
This can probably be changed.
The FIXME comment is yours, I think. The bug is mine, sorry.
And actually I am not sure whether I am correct with loading the whole file
from the archive into memory. The other archivers seem to decode only the
While my method is easier to implement and faster when reading from the file
more than once, it also pushes the memory requirements.
Do you think this should be changed?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part.
More information about the physfs