diff options
author | rubidium <rubidium@openttd.org> | 2008-10-28 14:42:31 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-10-28 14:42:31 +0000 |
commit | 0d2f84e117e06db09414ec55b0c0c79f3e8c7bdb (patch) | |
tree | b5fc23e46516c5f53edc37ad11559ac6e8586d4c /src/blitter | |
parent | 83e1a083d1e72dd97d4da87f3f5b055856e26b02 (diff) | |
download | openttd-0d2f84e117e06db09414ec55b0c0c79f3e8c7bdb.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.hpp | 6 |
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; } |