summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWalter Harms <wharms@bfs.de>2019-12-22 17:51:53 +0100
committerWalter Harms <wharms@bfs.de>2019-12-22 17:51:53 +0100
commitb2c33d42605147831c48a8946e90f356340e709e (patch)
treebf22c7cc8faa2725d36c6a2629d1d86f512bd6f9 /src
parent8fe25ef4a99c38abe31113d5cfa0b85c7cd5c2de (diff)
refactoring, reduce indent level
Signed-off-by: Walter Harms <wharms@bfs.de>
Diffstat (limited to 'src')
-rw-r--r--src/Varargs.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/Varargs.c b/src/Varargs.c
index 76bbeb9..7920e09 100644
--- a/src/Varargs.c
+++ b/src/Varargs.c
@@ -353,19 +353,20 @@ _XtVaToArgList(
Cardinal num_resources = 0;
Boolean fetched_resource_list = False;
- if (max_count == 0) {
- *num_args_return = 0;
- *args_return = (ArgList)NULL;
+ *num_args_return = 0;
+ *args_return = (ArgList)NULL;
+
+ if (max_count == 0)
return;
- }
args = (ArgList)__XtMalloc((Cardinal)((size_t)(max_count * 2) * sizeof(Arg)));
- if (args) {
- for (count = max_count * 2; --count >= 0; )
- args[count].value = (XtArgVal) NULL;
- count = 0;
+ if (!args)
+ return;
+ for (count = max_count * 2; --count >= 0; )
+ args[count].value = (XtArgVal) NULL;
+ count = 0;
- for(attr = va_arg(var, String) ; attr != NULL;
+ for(attr = va_arg(var, String) ; attr != NULL;
attr = va_arg(var, String)) {
if (strcmp(attr, XtVaTypedArg) == 0) {
typed_arg.name = va_arg(var, String);
@@ -399,9 +400,6 @@ _XtVaToArgList(
args[count].value = va_arg(var, XtArgVal);
count ++;
}
- }
- } else {
- count = 0;
}
XtFree((XtPointer)resources);