search for: 2ts7cx93

Displaying 6 results from an estimated 6 matches for "2ts7cx93".

2013 Jul 23
0
[LLVMdev] [Patch] WinCOFFObjectWriter: fix for storing pointer to string table in header name field
...uncates if there's not enough > space). Nuh uh: "The _snprintf function formats and stores count or fewer characters in buffer, and appends a terminating null character if the formatted string length is strictly less than count characters." http://msdn.microsoft.com/en-us/library/2ts7cx93(v=vs.100).aspx Please don't assume snprintf always null terminates. This may be Windows-specific behavior that you shouldn't rely on. If that's the case, ignore my suggestion. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pi...
2013 Mar 14
4
snprintf and MS Visual Studio
Hi all, There are a bunch of sprintf calls in the FLAC code base and I'd like to replace them with calls to snprintf but I know that can cause problems with at least some versions of Visual Studio. Whats the current state of play in this regard? Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
2013 Jul 23
4
[LLVMdev] [Patch] WinCOFFObjectWriter: fix for storing pointer to string table in header name field
On 23.07.2013 18:43, Reid Kleckner wrote: > Is there a problem if the string is not null terminated? If not, you can > snprintf it right into place instead of doing sprintf+mempcy. snprintf always null-terminates (and truncates if there's not enough space). -Nico
2013 Mar 15
2
snprintf and MS Visual Studio
...tionally. Hmm, the first can be used as a drop-in replacement for many but not all uses of ISO C99 snprintf. For the uses in FLAC, it should be sufficient, we just have to be careful not to rely on the return value. > DO NOT use > _snprintf: > http://msdn.microsoft.com/de-de/library/2ts7cx93(v=vs.80).aspx > > since this does not NULL terminate if the length of the buffer is equal > to the given buffer size (or larger than), and this differs from the std > behaviour as stated at e.g. http://linux.die.net/man/3/snprintf Yes, now I remember, that one is horribly broken. E...
2013 Mar 14
0
snprintf and MS Visual Studio
...osoft.com/de-de/library/f30dzcf6(v=VS.80).aspx The former can be used as a drop-in replacement of snprintf via a define, the latter takes an additional argument count which can limit the bytes written to the buffer additionally. DO NOT use _snprintf: http://msdn.microsoft.com/de-de/library/2ts7cx93(v=vs.80).aspx since this does not NULL terminate if the length of the buffer is equal to the given buffer size (or larger than), and this differs from the std behaviour as stated at e.g. http://linux.die.net/man/3/snprintf Christoph
2013 Mar 15
0
snprintf and MS Visual Studio
...e used as a drop-in replacement for many but > not all uses of ISO C99 snprintf. For the uses in FLAC, it should > be sufficient, we just have to be careful not to rely on the return > value. > >> DO NOT use >> _snprintf: >> http://msdn.microsoft.com/de-de/library/2ts7cx93(v=vs.80).aspx >> >> since this does not NULL terminate if the length of the buffer is equal >> to the given buffer size (or larger than), and this differs from the std >> behaviour as stated at e.g. http://linux.die.net/man/3/snprintf > > Yes, now I remember, that...