]> code.citadel.org Git - citadel.git/commitdiff
Fixed a potential infinite-loop condition in previous commit
authorArt Cancro <ajc@citadel.org>
Thu, 27 Mar 2008 02:55:57 +0000 (02:55 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 27 Mar 2008 02:55:57 +0000 (02:55 +0000)
citadel/msgbase.c

index 81ee81aa8e8c8e78b94324af31abdf17cb047ea7..107b1d5cb2a9fa32f73f34aea6d27c433d4d4fda 100644 (file)
@@ -1461,7 +1461,7 @@ int CtdlOutputPreLoadedMsg(
                int do_proto,           /* do Citadel protocol responses? */
                int crlf                /* Use CRLF newlines instead of LF? */
 ) {
-       int i, k;
+       int i, j, k;
        char buf[SIZ];
        cit_uint8_t ch;
        char allkeys[30];
@@ -1692,10 +1692,10 @@ int CtdlOutputPreLoadedMsg(
                                else if (i == 'W') {
                                        cprintf("References: ");
                                        k = num_tokens(mptr, '|');
-                                       for (i=0; i<k; ++i) {
-                                               extract_token(buf, mptr, i, '|', sizeof buf);
+                                       for (j=0; j<k; ++j) {
+                                               extract_token(buf, mptr, j, '|', sizeof buf);
                                                cprintf("<%s>", buf);
-                                               if (i == (k-1)) {
+                                               if (j == (k-1)) {
                                                        cprintf("%s", nl);
                                                }
                                                else {