]> code.citadel.org Git - citadel.git/commitdiff
Re-using the 'buf' variable in embed_room_banner() for
authorArt Cancro <ajc@citadel.org>
Thu, 12 Jul 2007 03:02:22 +0000 (03:02 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 12 Jul 2007 03:02:22 +0000 (03:02 +0000)
room name sanitization clobbered a bunch of variables that
we still needed, resulting (for example) in prompts such as
'0 new of 0 messages'.  Fixed.

webcit/roomops.c

index a6005641de2a466d38c30fee7adca94a2b242843..15243a0c88a152d800bdbd202623c321ec93e5eb 100644 (file)
@@ -439,6 +439,7 @@ void embed_search_o_matic(void) {
 
 void embed_room_banner(char *got, int navbar_style) {
        char buf[256];
+       char sanitized_roomname[256];
 
        /**
         * We need to have the information returned by a GOTO server command.
@@ -469,8 +470,8 @@ void embed_room_banner(char *got, int navbar_style) {
        WC->new_mail = extract_int(&got[4], 9);
        WC->wc_view = extract_int(&got[4], 11);
 
-       stresc(buf, WC->wc_roomname, 1, 1);
-       svprintf("ROOMNAME", WCS_STRING, "%s", buf);
+       stresc(sanitized_roomname, WC->wc_roomname, 1, 1);
+       svprintf("ROOMNAME", WCS_STRING, "%s", sanitized_roomname);
        svprintf("NUMMSGS", WCS_STRING,
                _("%d new of %d messages"),
                extract_int(&got[4], 1),