diff options
author | rubidium <rubidium@openttd.org> | 2014-04-24 19:51:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-04-24 19:51:45 +0000 |
commit | e61fe2123728dd4cd2eba3ed628905b337ddff19 (patch) | |
tree | aedd5865dbb78dc700d89d3f9478c73d90bcaf60 /src/string.cpp | |
parent | fad2d3c709a6d468024284d9e6b7830f7c62e917 (diff) | |
download | openttd-e61fe2123728dd4cd2eba3ed628905b337ddff19.tar.xz |
(svn r26506) -Codechange: replace most of vsnprintf with vseprintf
Diffstat (limited to 'src/string.cpp')
-rw-r--r-- | src/string.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/string.cpp b/src/string.cpp index 8a95d7b6f..63288e431 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -32,7 +32,10 @@ #include "gfx_func.h" #endif /* WITH_ICU */ +/* The function vsnprintf is used internally to perform the required formatting + * tasks. As such this one must be allowed, and makes sure it's terminated. */ #include "safeguards.h" +#undef vsnprintf /** * Safer implementation of vsnprintf; same as vsnprintf except: @@ -44,7 +47,7 @@ * @param ap the list of arguments for the format * @return the number of added characters */ -static int CDECL vseprintf(char *str, const char *last, const char *format, va_list ap) +int CDECL vseprintf(char *str, const char *last, const char *format, va_list ap) { ptrdiff_t diff = last - str; if (diff < 0) return 0; |