mirror of
https://github.com/cc65/cc65.git
synced 2024-12-25 02:29:52 +00:00
Abort on string overflow
git-svn-id: svn://svn.cc65.org/cc65/trunk@21 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
2d99d910b2
commit
58a9481d8d
@ -65,14 +65,14 @@ int xvsprintf (char* Buf, size_t BufSize, const char* Format, va_list ap)
|
||||
/* Replacement function for sprintf */
|
||||
{
|
||||
#if defined(__WATCOMC__)
|
||||
return _vbprintf (Buf, BufSize, Format, ap);
|
||||
int Res = _vbprintf (Buf, BufSize, Format, ap);
|
||||
#elsif defined(__GNUC__)
|
||||
return vsnprintf (Buf, BufSize, Format, ap);
|
||||
int Res = vsnprintf (Buf, BufSize, Format, ap);
|
||||
#else
|
||||
int Res = vsprintf (Buf, Format, ap);
|
||||
assert ((unsigned) Res < BufSize);
|
||||
return Res;
|
||||
#endif
|
||||
assert (Res >= 0 && (unsigned) Res < BufSize);
|
||||
return Res;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user