Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH 17/17: check widthp before deref (is this okay, or should it be *swidep = buf + *widthp ? *widthp : 0; or something)



---
 Src/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Src/utils.c b/Src/utils.c
index 72a0c9c..c10fb11 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -565,7 +565,7 @@ wcs_nicechar(wchar_t c, size_t *widthp, char **swidep)
 	      *swidep = buf + strlen(buf);
 	    return buf;
 	}
-	if (swidep)
+	if (swidep && widthp)
 	    *swidep = buf + *widthp;
 	return buf;
     }
-- 
2.2.0.GIT



Messages sorted by: Reverse Date, Date, Thread, Author