From: Art Cancro Date: Wed, 21 Jan 2009 04:48:37 +0000 (+0000) Subject: * ParsePref() was passing NULL values to the target buffer of the string tokenizer... X-Git-Tag: v7.86~1585 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=58f4b42b92231fc75532578af66cc5b776d1a54a * ParsePref() was passing NULL values to the target buffer of the string tokenizer, causing all preferences to be thrown away upon reading. Added allocation of StrBuf's for Key and Val members, so it has someplace to store them. --- diff --git a/webcit/preferences.c b/webcit/preferences.c index fae98f03a..860bafa0a 100644 --- a/webcit/preferences.c +++ b/webcit/preferences.c @@ -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");