Fixed infinite-loop bug in room name display code.
authorArt Cancro <ajc@citadel.org>
Thu, 17 Jan 2008 22:29:07 +0000 (22:29 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 17 Jan 2008 22:29:07 +0000 (22:29 +0000)
citadel/citserver.c

index 37a3f7280c16fb48f6dbd9074a24188633be9faf..012d839cb5757de320047e8649caf13bc8e72542 100644 (file)
@@ -657,7 +657,6 @@ void GenerateRoomDisplay(char *real_room,
                        struct CitContext *viewer) {
 
        int ra;
-       int rlen;
 
        strcpy(real_room, viewed->room.QRname);
        if (viewed->room.QRflags & QR_MAILBOX) {
@@ -671,10 +670,9 @@ void GenerateRoomDisplay(char *real_room,
        }
 
        if (viewed->cs_flags & CS_CHAT) {
-               rlen = strlen(real_room);
-               while (rlen < 14)
-                       real_room[rlen] = ' ';
-               real_room[15] = '\0';
+               while (strlen(real_room) < 14) {
+                       strcat(real_room, " ");
+               }
                strcpy(&real_room[14], "<chat>");
        }