summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2014-01-01 22:27:36 -0800
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2014-01-01 22:27:36 -0800
commit1e236565459d10c7ad85ebed285d2acfc4b15b69 (patch)
treebef4d76b928615c02dbbd5063142d0e80d1ffc1e
parent15d326027827c168511f923e72c64e2131515e19 (diff)
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 <jeremyhu@apple.com>
-rw-r--r--Bitmap.c3
1 files changed, 3 insertions, 0 deletions
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 <assert.h>
#include <stdio.h>
#include <math.h>
@@ -1238,6 +1239,8 @@ BWGetFilepath(Widget w, String *str)
String end;
*str = XtNewString(BW->bitmap.filename);
+ assert(*str);
+
end = strrchr(*str, '/');
if (end)