(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 83e1a083d1
commit 0d2f84e117
9 changed files with 97 additions and 41 deletions

View File

@@ -119,13 +119,13 @@ public:
static char *GetBlittersInfo(char *p, const char *last)
{
p += snprintf(p, last - p, "List of blitters:\n");
p += seprintf(p, last, "List of blitters:\n");
Blitters::iterator it = GetBlitters().begin();
for (; it != GetBlitters().end(); it++) {
BlitterFactoryBase *b = (*it).second;
p += snprintf(p, last - p, "%18s: %s\n", b->name, b->GetDescription());
p += seprintf(p, last, "%18s: %s\n", b->name, b->GetDescription());
}
p += snprintf(p, last - p, "\n");
p += seprintf(p, last, "\n");
return p;
}