This commit is contained in:
cpq
2020-12-24 19:10:54 +00:00
parent 4c3b97be7d
commit b2ab484883
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -3733,7 +3733,7 @@ int mg_vasprintf(char **buf, size_t size, const char *fmt, va_list ap) {
}
// Microsoft version of vsnprintf() is not always null-terminated, so put
// the terminator manually
(*buf)[len] = 0;
if (*buf != NULL) (*buf)[len] = 0;
// LCOV_EXCL_STOP
} else if (len >= (int) size) {
/// Standard-compliant code path. Allocate a buffer that is large enough
+1 -1
View File
@@ -190,7 +190,7 @@ int mg_vasprintf(char **buf, size_t size, const char *fmt, va_list ap) {
}
// Microsoft version of vsnprintf() is not always null-terminated, so put
// the terminator manually
(*buf)[len] = 0;
if (*buf != NULL) (*buf)[len] = 0;
// LCOV_EXCL_STOP
} else if (len >= (int) size) {
/// Standard-compliant code path. Allocate a buffer that is large enough