From 0d254e8914f294a8f9a0e177e2d0208e57b2d5c9 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 28 Oct 2008 14:42:31 +0000 Subject: (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. --- src/blitter/factory.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/blitter/factory.hpp') 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; } -- cgit v1.2.3-54-g00ecf