summaryrefslogtreecommitdiff
path: root/src/Varargs.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-05-06 16:38:46 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2019-05-06 18:04:09 -0400
commit86d7036808a6958f5937a81044262afe2658e6ec (patch)
tree57ab52cc2aa6d8928875b61e06a2d907a2b1e57a /src/Varargs.c
parenta9c54d128ac65a8fa065ef28cd51c42981949c60 (diff)
eliminate an unnecessary cast which gave a gcc warning and add a null-pointer check
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/Varargs.c')
-rw-r--r--src/Varargs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Varargs.c b/src/Varargs.c
index 0e1900b..619de5b 100644
--- a/src/Varargs.c
+++ b/src/Varargs.c
@@ -244,7 +244,7 @@ TypedArgToArg(
arg_return->value = *(XtArgVal *)to_val.addr;
else if (to_val.size > sizeof(XtArgVal)) {
arg_return->value = (XtArgVal) (void *) __XtMalloc(to_val.size);
- memory_return->value = (XtArgVal)
+ if ((memory_return->value = arg_return->value) != 0)
memcpy((void *)arg_return->value, to_val.addr, to_val.size);
}
}