diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2022-06-14 20:25:20 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2022-06-18 06:36:36 -0400 |
commit | a6685523e189c6330ba7007ecaf8f6d462b63024 (patch) | |
tree | a646fbda0518e415e8f570af4517dae9734395ab /src/Object.c | |
parent | 248f980a67ac721882465c48d60039ac70d3fa82 (diff) |
cppcheck and clang --analyze fixes
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/Object.c')
-rw-r--r-- | src/Object.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Object.c b/src/Object.c index 178bcb5..f5cfb91 100644 --- a/src/Object.c +++ b/src/Object.c @@ -166,10 +166,13 @@ ConstructCallbackOffsets(WidgetClass myWidgetClass) /* Count the number of callbacks */ resourceList = (XrmResourceList) myObjectClass->object_class.resources; - for (i = (int) myObjectClass->object_class.num_resources; --i >= 0; - resourceList++) - if (resourceList->xrm_type == QCallback) - tableSize++; + if (resourceList != NULL) { + for (i = (int) myObjectClass->object_class.num_resources; --i >= 0; + resourceList++) { + if (resourceList->xrm_type == QCallback) + tableSize++; + } + } /* * Allocate and load the table. Make sure that the new callback |