'snprintf()' guarantees null termination of buffer
Thanks @cremno.
This commit is contained in:
parent
794e86d0ab
commit
e72bced0f7
4 changed files with 0 additions and 4 deletions
|
@ -213,7 +213,6 @@ SoundBuffer *SoundEmitter::allocateBuffer(const std::string &filename)
|
|||
char buf[512];
|
||||
snprintf(buf, sizeof(buf), "Unable to decode sound: %s.%s: %s",
|
||||
filename.c_str(), ext, Sound_GetError());
|
||||
buf[sizeof(buf)-1] = '\0';
|
||||
Debug() << buf;
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue