From 1e236565459d10c7ad85ebed285d2acfc4b15b69 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Wed, 1 Jan 2014 22:27:36 -0800 Subject: assert to avoid a NULL dereference Bitmap.c:1246:8: warning: Dereference of null pointer **str = '\0'; ~~~~~~^~~~~~ 1 warning generated. Signed-off-by: Jeremy Huddleston Sequoia --- Bitmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Bitmap.c b/Bitmap.c index 704cb98..bcab0ab 100644 --- a/Bitmap.c +++ b/Bitmap.c @@ -41,6 +41,7 @@ from The Open Group. #include "BitmapP.h" #include "Bitmap.h" +#include #include #include @@ -1238,6 +1239,8 @@ BWGetFilepath(Widget w, String *str) String end; *str = XtNewString(BW->bitmap.filename); + assert(*str); + end = strrchr(*str, '/'); if (end) -- cgit v1.2.3