mirror of
https://github.com/albertodemichelis/squirrel.git
synced 2026-01-12 14:38:42 +01:00
The number returned by vsnprintf contains the actual number of characters. If the message was smaller than the estimated size. It would've created a string with garbage after the null character.
This commit is contained in:
@ -1146,7 +1146,7 @@ begin:
|
||||
} else if (r<0) {
|
||||
v->_lasterror=SQString::Create(_ss(v),_SC("@failed to generate formatted error message"));
|
||||
} else {
|
||||
v->_lasterror=SQString::Create(_ss(v),b,n);
|
||||
v->_lasterror=SQString::Create(_ss(v),b,r);
|
||||
}
|
||||
return SQ_ERROR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user