Fixed shown random data if no header was set.
authorDaniel Carl <danielcarl@gmx.de>
Wed, 23 Apr 2014 22:00:36 +0000 (00:00 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Wed, 23 Apr 2014 22:00:36 +0000 (00:00 +0200)
If the user run `set header=|set header?` there was displayed some random
data because we tried to skip the first ',' of the string event if the string
was empty.

src/setting.c

index 09a357c..5bb6ce0 100644 (file)
@@ -860,7 +860,7 @@ static SettingStatus headers(const Setting *s, const SettingType type)
             }
 
             /* skip the first ',' we put into the headers string */
-            print_value(s, str->str + 1);
+            print_value(s, *(str->str) == ',' ? str->str + 1 : str->str);
             g_string_free(str, true);
         } else {
             print_value(s, &"");