* CtdlIPCGetMessages(): Fix message read failing on first attempt to read
authorMichael Hampton <io_error@uncensored.citadel.org>
Thu, 16 Jan 2003 21:16:23 +0000 (21:16 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Thu, 16 Jan 2003 21:16:23 +0000 (21:16 +0000)
  messages

citadel/ChangeLog
citadel/citadel_ipc.c
citadel/messages.c

index 4a78156b77695f4d62184ad679e7b85c9e5b5364..97a26da02f43d91ce148af70b7ca631a03c4d3ff 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 601.114  2003/01/16 21:16:23  error
+ * CtdlIPCGetMessages(): Fix message read failing on first attempt to read
+   messages
+
  Revision 601.113  2003/01/16 10:04:03  error
  * ENT0 command: changed post-as username from arg 4 to arg 5; 4 was already
    used as the message subject
@@ -4402,4 +4406,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index 53c9f7f6497879815e4cc54760697602625a7a82..8b1eff7226bd49f79a52c278a204f01b717d8720 100644 (file)
@@ -434,7 +434,7 @@ int CtdlIPCGetMessages(CtdlIPC *ipc, enum MessageList which, int whicharg,
        if (ret / 100 != 1)
                return ret;
        count = 0;
-       *mret = (unsigned long *)malloc(sizeof(unsigned long));
+       *mret = (unsigned long *)calloc(1, sizeof(unsigned long));
        if (!*mret)
                return -1;
        while (bbb && strlen(bbb)) {
index c02ceb4ec3dc24686cbc56e565fd9d561b87acb8..e222b00120bf71ccaf727b0b27e3537d83ff024f 100644 (file)
@@ -1279,11 +1279,11 @@ void readmsgs(CtdlIPC *ipc,
                        ;
        }
 
-       if (num_msgs == 0) {
-               if (c == 3) return;
+       if (num_msgs == 0) {    /* TODO look at this later */
+               if (c == LastMessages) return;
                scr_printf("*** There are no ");
-               if (c == 1) scr_printf("new ");
-               if (c == 2) scr_printf("old ");
+               if (c == NewMessages) scr_printf("new ");
+               if (c == OldMessages) scr_printf("old ");
                scr_printf("messages in this room.\n");
                return;
        }