Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 22 lines 561 B view raw
1diff --git a/daxctl/device.c b/daxctl/device.c 2index e3993b1..0b2f20d 100644 3--- a/daxctl/device.c 4+++ b/daxctl/device.c 5@@ -23,6 +23,8 @@ 6 #include "filter.h" 7 #include "json.h" 8 9+#include <libgen.h> 10+ 11 static struct { 12 const char *dev; 13 const char *mode; 14@@ -366,7 +368,7 @@ static const char *parse_device_options(int argc, const char **argv, 15 16 argc = parse_options(argc, argv, options, u, 0); 17 if (argc > 0) 18- device = basename(argv[0]); 19+ device = basename(strdup(argv[0])); 20 21 /* Handle action-agnostic non-option arguments */ 22 if (argc == 0 &&