diff options
author | Przemyslaw Pawelczyk <przemoc@gmail.com> | 2018-01-23 15:17:29 +0100 |
---|---|---|
committer | Przemyslaw Pawelczyk <przemoc@gmail.com> | 2018-01-23 15:17:29 +0100 |
commit | 75c68929c302b7d3cca77c3cf542dd299d18394a (patch) | |
tree | d83f760d69b78f54522ed93940d473372f87468e /src | |
parent | 2d96df3dd6f352d522a224643b6206e680855398 (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).
Diffstat (limited to 'src')
-rw-r--r-- | src/utils.c | 2 |
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++) |