commit: c8a2a927ac04b648c25b574efbe162fa6983ff8a
parent 53cb7ab47c34ae3b444fac527cd22f7770ab30f9
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Thu, 24 Jul 2025 20:52:47 +0200
cmd/strings: strictly check for negative fd
Avoids false positive from gcc 14.3.0 p8 analyzer
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/strings.c b/cmd/strings.c
@@ -200,7 +200,7 @@ main(int argc, char *argv[])
else
{
int fd = open(argv[argi], O_RDONLY);
- if(fd <= 0)
+ if(fd < 0)
{
fprintf(stderr, "strings: error: Failed opening ā%sā: %s\n", argv[argi], strerror(errno));
return 1;