(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:
rubidium
2008-10-28 14:42:31 +00:00
parent cf4cffd91a
commit 0d254e8914
9 changed files with 97 additions and 41 deletions

View File

@@ -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"