iotools: Fix werror and refactor definition

Changed files
+20 -5
pkgs
+13
pkgs/by-name/io/iotools/001-fix-werror-in-sprintf.patch
···
+
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';
+
+ }
+7 -5
pkgs/by-name/io/iotools/package.nix
···
fetchFromGitHub,
}:
-
stdenv.mkDerivation {
+
stdenv.mkDerivation (finalAttrs: {
pname = "iotools";
version = "unstable-2017-12-11";
···
hash = "sha256-tlGXJn3n27mQDupMIVYDd86YaWazVwel/qs0QqCy1W8=";
};
+
patches = [ ./001-fix-werror-in-sprintf.patch ];
+
makeFlags = [
"DEBUG=0"
"STATIC=0"
···
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 = ''
···
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";
};
-
}
+
})