summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaan Leijen <daan@microsoft.com>2021-10-19 15:13:01 -0700
committerDaan Leijen <daan@microsoft.com>2021-10-19 15:13:01 -0700
commit10c31f9b41f5559e459dc30cf463cc750bfa67ac (patch)
tree63271c546eb9528bd5fc2dcd766b5abb1d1f885c
parent505ea78caef704eab47cd658973d3d55e3223262 (diff)
fix warnings
-rw-r--r--src/stats.c4
-rw-r--r--test/test-api.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/stats.c b/src/stats.c
index dda55cd..115d938 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -153,8 +153,8 @@ static void mi_printf_amount(int64_t n, int64_t unit, mi_output_fun* out, void*
const int64_t tens = (n / (divider/10));
const long whole = (long)(tens/10);
const long frac1 = (long)(tens%10);
- char unitdesc[16];
- snprintf(unitdesc, 16, "%s%s%s", magnitude, (base==1024 ? "i" : ""), suffix);
+ char unitdesc[8];
+ snprintf(unitdesc, 8, "%s%s%s", magnitude, (base==1024 ? "i" : ""), suffix);
snprintf(buf, len, "%ld.%ld %-3s", whole, (frac1 < 0 ? -frac1 : frac1), unitdesc);
}
_mi_fprintf(out, arg, (fmt==NULL ? "%11s" : fmt), buf);
diff --git a/test/test-api.c b/test/test-api.c
index 55c8043..f72cfaf 100644
--- a/test/test-api.c
+++ b/test/test-api.c
@@ -4,6 +4,7 @@ This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/
+#pragma GCC diagnostic ignored "-Walloc-size-larger-than="
/*
Testing allocators is difficult as bugs may only surface after particular