Welcome to little lamb

Code » limb » commit 745bd41

open_saread_closeat(): Fix wrong return value when open fails

author Olivier Brunel
2023-12-16 20:56:56 UTC
committer Olivier Brunel
2024-01-01 19:10:12 UTC
parent bb6a3c36d147ab4d30d14f86755f1c3526b821d6

open_saread_closeat(): Fix wrong return value when open fails

src/liblimb/djbunix.h/open_saread_closeat.c +1 -1

diff --git a/src/liblimb/djbunix.h/open_saread_closeat.c b/src/liblimb/djbunix.h/open_saread_closeat.c
index d7b09cb..d6c5e35 100644
--- a/src/liblimb/djbunix.h/open_saread_closeat.c
+++ b/src/liblimb/djbunix.h/open_saread_closeat.c
@@ -7,7 +7,7 @@ int
 open_saread_closeat(stralloc *sa, int bfd, const char *file)
 {
     int fd = openb_readat(bfd, file);
-    if (fd < 0) return -1;
+    if (fd < 0) return 0;
 
     int r = sa_read(sa, fd);
     fd_close(fd);