Fix STL header writing (really)

The vsnprintf call must be passed the buffer size, not the target string size. Shortening the string to field length happens in the memcpy.
This commit is contained in:
Niels Martin Hansen 2016-05-18 21:56:34 +02:00
parent 0e8bc44539
commit b118fe7e7a
1 changed files with 1 additions and 1 deletions

View File

@ -531,7 +531,7 @@ namespace
char buf[16];
va_list ap;
va_start(ap, format);
vsnprintf(buf, fieldlen, format, ap);
vsnprintf(buf, sizeof(buf), format, ap);
memcpy(field, buf, fieldlen);