summaryrefslogtreecommitdiff
path: root/src/blitter
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-10-28 14:42:31 +0000
committerrubidium <rubidium@openttd.org>2008-10-28 14:42:31 +0000
commit0d254e8914f294a8f9a0e177e2d0208e57b2d5c9 (patch)
treeb5fc23e46516c5f53edc37ad11559ac6e8586d4c /src/blitter
parentcf4cffd91adbe563e4cd9f892ad3ab54a2fef13e (diff)
downloadopenttd-0d254e8914f294a8f9a0e177e2d0208e57b2d5c9.tar.xz
(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.
Diffstat (limited to 'src/blitter')
-rw-r--r--src/blitter/factory.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/blitter/factory.hpp b/src/blitter/factory.hpp
index 304d73832..30b680506 100644
--- a/src/blitter/factory.hpp
+++ b/src/blitter/factory.hpp
@@ -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;
}