From 15925535271fd588b156f514c9bd2f8823cfff6b Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 7 Mar 2018 04:38:29 +0100 Subject: starbound: Fix preloader snprintf size I explicitly didn't want to include a \0, but unfortunately with GCC 7 a check is performed on the size of the format arguments and the build now fails with: '__builtin___snprintf_chk' output between 5 and 9 bytes into a destination of size 4 The dereference of the str pointer gives us one byte, so the size of the format argument will be 4 in any cases plus the 0 byte at the end. While we don't need the 0 byte because it will be added later, it doesn't hurt so let's use a maximum size of 5 to keep GCC 7 silent. Signed-off-by: aszlig --- pkgs/games/humblebundle/starbound.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/games/humblebundle/starbound.nix') diff --git a/pkgs/games/humblebundle/starbound.nix b/pkgs/games/humblebundle/starbound.nix index 921f652b..2c63cb0d 100644 --- a/pkgs/games/humblebundle/starbound.nix +++ b/pkgs/games/humblebundle/starbound.nix @@ -118,7 +118,7 @@ let if (*str >= 0 && *str <= 31) { *out++ = '\\'; *out++ = 'u'; - snprintf(out, 4, "%04x", *str); + snprintf(out, 5, "%04x", *str); out += 4; } else { *out++ = *str; -- cgit 1.4.1