void-packages/srcpkgs/xsel/patches/strncpy.patch

14 lines
387 B
Diff

diff --git xsel.c xsel.c
index 79cc68b..556585e 100644
--- a/xsel.c
+++ b/xsel.c
@@ -1983,7 +1983,7 @@ main(int argc, char *argv[])
dont_output = True;
} else if (OPT("--logfile") || OPT("-l")) {
i++; if (i >= argc) goto usage_err;
- strncpy (logfile, argv[i], MAXFNAME);
+ strncpy (logfile, argv[i], MAXFNAME-1);
} else {
goto usage_err;
}