* fix some conditions with unassigned variable access
authorWilfried Göesgens <willi@citadel.org>
Sun, 14 Dec 2008 22:04:50 +0000 (22:04 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 14 Dec 2008 22:04:50 +0000 (22:04 +0000)
webcit/messages.c
webcit/roomops.c

index 93bedd32199261dcabcf2377f60e46f6aaee7022..9103e290d5b5ef50941ce8faa42ecc2812496e1d 100644 (file)
@@ -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;
 
index 6a41b0c41e358859cb8d091f1ecc98bd6a8406e4..affe750aa0a109f659f29c2c084b16b9c214d847 100644 (file)
@@ -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];