Loading pkgs/by-name/io/iotools/001-fix-werror-in-sprintf.patch 0 → 100644 +13 −0 Original line number Diff line number Diff line diff --git a/commands.c b/commands.c index a83f1d5..b3f217a 100644 --- a/commands.c +++ b/commands.c @@ -152,1 +152,7 @@ build_symlink_name(const char *path_to_bin, const struct cmd_info *cmd) - snprintf(link_name, FILENAME_MAX, "%s/%s", path_to_bin, cmd->name); + int result = snprintf(link_name, FILENAME_MAX, "%s/%s", path_to_bin, cmd->name); + + if (result >= FILENAME_MAX) { + link_name[FILENAME_MAX - 1] = '\0'; + } else if (result < 0) { + link_name[0] = '\0'; + } pkgs/by-name/io/iotools/package.nix +7 −5 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ fetchFromGitHub, }: stdenv.mkDerivation { stdenv.mkDerivation (finalAttrs: { pname = "iotools"; version = "unstable-2017-12-11"; Loading @@ -15,6 +15,8 @@ stdenv.mkDerivation { hash = "sha256-tlGXJn3n27mQDupMIVYDd86YaWazVwel/qs0QqCy1W8="; }; patches = [ ./001-fix-werror-in-sprintf.patch ]; makeFlags = [ "DEBUG=0" "STATIC=0" Loading @@ -24,7 +26,7 @@ stdenv.mkDerivation { install -Dm755 iotools -t $out/bin ''; meta = with lib; { meta = { description = "Set of simple command line tools which allow access to hardware device registers"; longDescription = '' Loading @@ -35,12 +37,12 @@ stdenv.mkDerivation { operations. ''; homepage = "https://github.com/adurbin/iotools"; license = licenses.gpl2Only; maintainers = with maintainers; [ felixsinger ]; license = lib.licenses.gpl2Only; maintainers = with lib.maintainers; [ felixsinger ]; platforms = [ "x86_64-linux" "i686-linux" ]; mainProgram = "iotools"; }; } }) Loading
pkgs/by-name/io/iotools/001-fix-werror-in-sprintf.patch 0 → 100644 +13 −0 Original line number Diff line number Diff line diff --git a/commands.c b/commands.c index a83f1d5..b3f217a 100644 --- a/commands.c +++ b/commands.c @@ -152,1 +152,7 @@ build_symlink_name(const char *path_to_bin, const struct cmd_info *cmd) - snprintf(link_name, FILENAME_MAX, "%s/%s", path_to_bin, cmd->name); + int result = snprintf(link_name, FILENAME_MAX, "%s/%s", path_to_bin, cmd->name); + + if (result >= FILENAME_MAX) { + link_name[FILENAME_MAX - 1] = '\0'; + } else if (result < 0) { + link_name[0] = '\0'; + }
pkgs/by-name/io/iotools/package.nix +7 −5 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ fetchFromGitHub, }: stdenv.mkDerivation { stdenv.mkDerivation (finalAttrs: { pname = "iotools"; version = "unstable-2017-12-11"; Loading @@ -15,6 +15,8 @@ stdenv.mkDerivation { hash = "sha256-tlGXJn3n27mQDupMIVYDd86YaWazVwel/qs0QqCy1W8="; }; patches = [ ./001-fix-werror-in-sprintf.patch ]; makeFlags = [ "DEBUG=0" "STATIC=0" Loading @@ -24,7 +26,7 @@ stdenv.mkDerivation { install -Dm755 iotools -t $out/bin ''; meta = with lib; { meta = { description = "Set of simple command line tools which allow access to hardware device registers"; longDescription = '' Loading @@ -35,12 +37,12 @@ stdenv.mkDerivation { operations. ''; homepage = "https://github.com/adurbin/iotools"; license = licenses.gpl2Only; maintainers = with maintainers; [ felixsinger ]; license = lib.licenses.gpl2Only; maintainers = with lib.maintainers; [ felixsinger ]; platforms = [ "x86_64-linux" "i686-linux" ]; mainProgram = "iotools"; }; } })