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 | 0d254e8914f294a8f9a0e177e2d0208e57b2d5c9 (patch) | |
tree | b5fc23e46516c5f53edc37ad11559ac6e8586d4c /src/newgrf_config.cpp | |
parent | cf4cffd91adbe563e4cd9f892ad3ab54a2fef13e (diff) | |
download | openttd-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/newgrf_config.cpp')
-rw-r--r-- | src/newgrf_config.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index 235e543f8..d52ee828c 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -479,7 +479,7 @@ char *GRFBuildParamList(char *dst, const GRFConfig *c, const char *last) for (i = 0; i < c->num_params; i++) { if (i > 0) dst = strecpy(dst, " ", last); - dst += snprintf(dst, last - dst, "%d", c->param[i]); + dst += seprintf(dst, last, "%d", c->param[i]); } return dst; } |