From 58f4b42b92231fc75532578af66cc5b776d1a54a Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 21 Jan 2009 04:48:37 +0000 Subject: [PATCH] * 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. --- webcit/preferences.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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"); -- 2.30.2