[dia] [scan-build] Null pointer passed as an argument to a 'nonnull' parameter



commit b338e54bde54c321136a175c7dee20a9e2527fc7
Author: Hans Breuer <hans breuer org>
Date:   Fri Oct 4 16:27:48 2013 +0200

    [scan-build] Null pointer passed as an argument to a 'nonnull' parameter
    
    chronoline_event.c:268:7: warning: Null pointer passed as an argument to
    a 'nonnull' parameter
      if (strchr(events, ',') != NULL) {
          ^      ~~~~~~

 objects/chronogram/chronoline_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/objects/chronogram/chronoline_event.c b/objects/chronogram/chronoline_event.c
index 05f0c0d..01afefc 100644
--- a/objects/chronogram/chronoline_event.c
+++ b/objects/chronogram/chronoline_event.c
@@ -265,7 +265,7 @@ reparse_clevent(const gchar *events, CLEventList **lst,
   if ((newsum == *chksum) && (*lst)) return;
 
   /* the string might contain ',' as a decimal separtor, fix it on the fly */
-  if (strchr(events, ',') != NULL) {
+  if (events && strchr(events, ',') != NULL) {
     gchar *p;
 
     ps = g_strdup(events);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]