More tests

This commit is contained in:
cpq committed 2020-12-07 08:54:58 +00:00
1 parent 082a498afd
commit 7ea3293aba
4 files changed
+31 -6

No files matched your search

+3 -2
View File
@@ -174,7 +174,8 @@ int mg_vasprintf(char **buf, size_t size, const char *fmt, va_list ap) {
// eCos and Windows are not standard-compliant and return -1 when
// the buffer is too small. Keep allocating larger buffers until we
// succeed or out of memory.
*buf = NULL; // LCOV_EXCL_START
// LCOV_EXCL_START
*buf = NULL;
while (len < 0) {
free(*buf);
if (size == 0) size = 5;
@@ -190,7 +191,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;
/// LCOV_EXCL_STOP
// LCOV_EXCL_STOP
} else if (len >= (int) size) {
/// Standard-compliant code path. Allocate a buffer that is large enough
if ((*buf = (char *) malloc(len + 1)) == NULL) {