summaryrefslogtreecommitdiff
path: root/src/Converters.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-05-16 20:53:42 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2019-05-18 06:42:03 -0400
commit1f0e3238352a497a59a36e0b8a5b4723c634b2e1 (patch)
treed49a598905cf10e28ff7d21a627e2f90a6e79ada /src/Converters.c
parentfb78a7c881adbe46f1f8c6e8e429bc8963c9b3e8 (diff)
fix most clang --analyze warnings about null-pointers
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/Converters.c')
-rw-r--r--src/Converters.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Converters.c b/src/Converters.c
index 32e3641..bf91f1f 100644
--- a/src/Converters.c
+++ b/src/Converters.c
@@ -561,15 +561,16 @@ static void FetchDisplayArg(
Cardinal *size,
XrmValue* value)
{
- if (widget == NULL)
+ if (widget == NULL) {
XtErrorMsg("missingWidget", "fetchDisplayArg", XtCXtToolkitError,
"FetchDisplayArg called without a widget to reference",
NULL, NULL);
/* can't return any useful Display and caller will de-ref NULL,
so aborting is the only useful option */
-
- value->size = sizeof(Display*);
- value->addr = (XPointer)&DisplayOfScreen(XtScreenOfObject(widget));
+ } else {
+ value->size = sizeof(Display*);
+ value->addr = (XPointer)&DisplayOfScreen(XtScreenOfObject(widget));
+ }
}
static XtConvertArgRec const displayConvertArg[] = {