PATCH: pathprog used a signed char as a buffer size

Mikael Magnusson <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <[email protected]>
---
 Src/utils.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Src/utils.c b/Src/utils.c
index 94844e4229..3d387f967b 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -760,12 +760,13 @@ zwcwidth(wint_t wc)
 char *
 pathprog(char *prog, char **namep)
 {
-    char **pp, ppmaxlen = 0, *buf, *funmeta;
+    char **pp, *buf, *funmeta;
+    size_t ppmaxlen = 0;
     struct stat st;
 
     for (pp = path; *pp; pp++)
     {
-	int len = strlen(*pp);
+	size_t len = strlen(*pp);
 	if (len > ppmaxlen)
 	    ppmaxlen = len;
     }
-- 
2.38.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.