(svn r14540) -Codechange: introduce [v]seprintf which are like [v]snprintf but do return the number of characters written instead of the number of characters that would be written; as size_t is unsigned substraction can cause integer underflows quite quickly.
This commit is contained in:
@@ -166,7 +166,7 @@ static void ShowHelp()
|
||||
char buf[4096];
|
||||
char *p = buf;
|
||||
|
||||
p += snprintf(p, lengthof(buf), "OpenTTD %s\n", _openttd_revision);
|
||||
p += seprintf(p, lastof(buf), "OpenTTD %s\n", _openttd_revision);
|
||||
p = strecpy(p,
|
||||
"\n"
|
||||
"\n"
|
||||
|
Reference in New Issue
Block a user