diff options
-rw-r--r-- | src/string.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.cpp b/src/string.cpp index eeca3e809..872b6e08f 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -169,7 +169,7 @@ int CDECL vsnprintf(char *str, size_t size, const char *format, va_list ap) { int ret; ret = _vsnprintf(str, size, format, ap); - if (ret < 0 || ret == 0) str[size - 1] = '\0'; + if (ret < 0 || ret == size) str[size - 1] = '\0'; return ret; } #endif /* _MSC_VER */ |