Abort on string overflow

git-svn-id: svn://svn.cc65.org/cc65/trunk@21 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2000-06-01 16:41:28 +00:00
parent 2d99d910b2
commit 58a9481d8d
1 changed files with 4 additions and 4 deletions

View File

@ -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;
}