summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrzemyslaw Pawelczyk <przemoc@gmail.com>2018-01-23 15:17:29 +0100
committerPrzemyslaw Pawelczyk <przemoc@gmail.com>2018-01-23 15:17:29 +0100
commit75c68929c302b7d3cca77c3cf542dd299d18394a (patch)
treed83f760d69b78f54522ed93940d473372f87468e
parent2d96df3dd6f352d522a224643b6206e680855398 (diff)
Fix sparse warning: Variable length array is used.
Avoid using VLAs when it is not really needed, especially in cases like this one here, when possible array size is very limited (1-8 bytes).
-rw-r--r--src/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c
index 78f03d2..4cba896 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -120,7 +120,7 @@ xfwrite(const void *ptr, size_t size, FILE *stream)
void
write_int(uint64_t value, size_t len, FILE *to)
{
- char buf[len];
+ char buf[sizeof(value)];
size_t i;
for (i = 0; i < len; i++)