From: Wilfried Göesgens Date: Sun, 14 Dec 2008 22:04:50 +0000 (+0000) Subject: * fix some conditions with unassigned variable access X-Git-Tag: v7.86~1705 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=6db78305cf611e882a77ed3cdb36eca2d0b7179c;p=citadel.git * fix some conditions with unassigned variable access --- diff --git a/webcit/messages.c b/webcit/messages.c index 93bedd321..9103e290d 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -487,7 +487,7 @@ void DrawMessageDropdown(StrBuf *Selector, long maxmsgs, long startmsg) message_summary* Msg; int lo, hi, n; int i = 0; - long StartMsg; + long StartMsg = 0; void *vMsg; long hklen; const char *key; @@ -653,16 +653,6 @@ void readloop(long oper) bbs_reverse = is_bbview && (lbstr("SortOrder") == 2); - if (is_bbview && (startmsg == 0L)) { - if (bbs_reverse) { - Msg = GetMessagePtrAt((nummsgs >= maxmsgs) ? (nummsgs - maxmsgs) : 0, WCC->summ); - startmsg = (Msg==NULL)? 0 : Msg->msgnum; - } - else { - Msg = GetMessagePtrAt(0, WCC->summ); - startmsg = (Msg==NULL)? 0 : Msg->msgnum; - } - } sortit = is_summary || WCC->is_mobile; } @@ -703,7 +693,18 @@ void readloop(long oper) goto DONE; } + if (is_bbview && (startmsg == 0L)) { + if (bbs_reverse) { + Msg = GetMessagePtrAt((nummsgs >= maxmsgs) ? (nummsgs - maxmsgs) : 0, WCC->summ); + startmsg = (Msg==NULL)? 0 : Msg->msgnum; + } + else { + Msg = GetMessagePtrAt(0, WCC->summ); + startmsg = (Msg==NULL)? 0 : Msg->msgnum; + } + } + /* This is done to make it run faster; WC is a function */ if (load_seen){ void *vMsg; diff --git a/webcit/roomops.c b/webcit/roomops.c index 6a41b0c41..affe750aa 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -1114,7 +1114,7 @@ void display_editroom(void) char node[256]; char remote_room[128]; char recp[1024]; - char er_name[128]; + char er_name[128] = ""; char er_password[10]; char er_dirname[15]; char er_roomaide[26];