From 75c68929c302b7d3cca77c3cf542dd299d18394a Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Tue, 23 Jan 2018 15:17:29 +0100 Subject: 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). --- src/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/utils.c') 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++) -- cgit v1.2.1