2006-05-16 [colin] 2.2.0cvs22
[claws.git] / src / mainwindow.c
index 0bba138ffbb97351a7b454fbb9b393b9abc0c316..d845950d8b44f683b2a3b398a17380fd6669e29f 100644 (file)
@@ -2395,9 +2395,15 @@ static void get_url_part (const gchar **buffer, gchar *url_decoded, gint maxlen)
 
        /* Prepare the work for the next url in the list */
        /* after the closing bracket >, ignore space, comments and tabs */
-       for (;*buf == ' ' || *buf == '(' || *buf == '\t'; buf++)
+       for (;*buf && *buf && (buf == ' ' || *buf == '(' || *buf == '\t'); buf++)
                if (*buf == '(')
                        for (;*buf != ')' && *buf != 0x00; buf++);
+                       
+       if (!buf) {
+               *buffer = NULL;
+               return;
+       }
+
        /* now first non space, non comment must be a comma */
        if (*buf != ',')
                for (;*buf != 0x00; buf++);