* ParsePref() was passing NULL values to the target buffer of the string tokenizer...
authorArt Cancro <ajc@citadel.org>
Wed, 21 Jan 2009 04:48:37 +0000 (04:48 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 21 Jan 2009 04:48:37 +0000 (04:48 +0000)
webcit/preferences.c

index fae98f03a8bfeb0fd2cf2e4b9bc00a3986389ab8..860bafa0a3de99148f06576b11c8975f1649be3d 100644 (file)
@@ -121,6 +121,8 @@ void ParsePref(HashList **List, StrBuf *ReadBuf)
                else {
                        LastData = Data = malloc(sizeof(Preference));
                        memset(Data, 0, sizeof(Preference));
+                       Data->Key = NewStrBuf();
+                       Data->Val = NewStrBuf();
                        StrBufExtract_token(Data->Key, ReadBuf, 0, '|');
                        StrBufExtract_token(Data->Val, ReadBuf, 1, '|');
                        if (!IsEmptyStr(ChrPtr(Data->Key)))
@@ -153,8 +155,7 @@ void load_preferences(void)
        char buf[SIZ];
        long msgnum = 0L;
        
-       if (!goto_config_room())
-               return;
+       if (goto_config_room() != 0) return;    /* oh well. */
 
        ReadBuf = NewStrBuf();
        serv_puts("MSGS ALL|0|1");