Fix wrong return value type.
authorwwp <wwp@free.fr>
Wed, 8 Feb 2017 22:33:38 +0000 (23:33 +0100)
committerwwp <wwp@free.fr>
Wed, 8 Feb 2017 22:33:38 +0000 (23:33 +0100)
src/common/utils.c

index cb4822151468678bcbd499d7b0f0991bcbe71520..df751e93e41b9d2d0c8c4a18a61f240617f68f0c 100644 (file)
@@ -1089,13 +1089,13 @@ static const gchar * line_has_quote_char_last(const gchar * str, const gchar *qu
        gchar * tmp_pos = NULL;
        int i;
 
-       if (quote_chars == NULL)
+       if (str == NULL || quote_chars == NULL)
                return NULL;
 
        for (i = 0; i < strlen(quote_chars); i++) {
-               tmp_pos = strrchr (str, quote_chars[i]);
+               tmp_pos = strrchr (str, quote_chars[i]);
                if(position == NULL
-                  || (tmp_pos != NULL && position <= tmp_pos) )
+                               || (tmp_pos != NULL && position <= tmp_pos) )
                        position = tmp_pos;
        }
        return position;
@@ -1178,13 +1178,13 @@ const gchar * line_has_quote_char(const gchar * str, const gchar *quote_chars)
        gchar * tmp_pos = NULL;
        int i;
 
-       if (quote_chars == NULL)
-               return FALSE;
+       if (str == NULL || quote_chars == NULL)
+               return NULL;
 
        for (i = 0; i < strlen(quote_chars); i++) {
-               tmp_pos = strchr (str,  quote_chars[i]);
+               tmp_pos = strchr (str, quote_chars[i]);
                if(position == NULL
-                  || (tmp_pos != NULL && position >= tmp_pos) )
+                               || (tmp_pos != NULL && position >= tmp_pos) )
                        position = tmp_pos;
        }
        return position;