* quickie_message() null handling
authorArt Cancro <ajc@citadel.org>
Fri, 16 Aug 2002 20:52:14 +0000 (20:52 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 16 Aug 2002 20:52:14 +0000 (20:52 +0000)
citadel/msgbase.c

index c10ad6159ae92adaf3212c841e350958486ecfcc..997cdd0177809d3037a371a34c8439b6e1c8b430 100644 (file)
@@ -1896,7 +1896,12 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,      /* message to save */
                }
        }
 
-       strcpy(force_room, force);
+       if (force == NULL) {
+               strcpy(force_room, "");
+       }
+       else {
+               strcpy(force_room, force);
+       }
 
        /* Learn about what's inside, because it's what's inside that counts */
        lprintf(9, "Learning what's inside\n");
@@ -2147,7 +2152,7 @@ void quickie_message(char *from, char *to, char *room, char *text)
        msg->cm_anon_type = MES_NORMAL;
        msg->cm_format_type = 0;
        msg->cm_fields['A'] = strdoop(from);
-       msg->cm_fields['O'] = strdoop(room);
+       if (room != NULL) msg->cm_fields['O'] = strdoop(room);
        msg->cm_fields['N'] = strdoop(NODENAME);
        if (to != NULL) {
                msg->cm_fields['R'] = strdoop(to);