]> granicus.if.org Git - php/commitdiff
Comming a fix for a compile error found in Bug #15630
authorDan Kalowsky <kalowsky@php.net>
Wed, 14 Aug 2002 20:55:11 +0000 (20:55 +0000)
committerDan Kalowsky <kalowsky@php.net>
Wed, 14 Aug 2002 20:55:11 +0000 (20:55 +0000)
# NOTE this is NOT the supplied patch in said bug for fixing imap_utf7_decode

ext/imap/php_imap.c

index ede672437fcc659d03eb870bba63985551dbf1d5..0298e3e2be361a3e0b4db216b81cf3ca60fa6bf0 100644 (file)
@@ -2049,6 +2049,7 @@ PHP_FUNCTION(imap_utf7_decode)
        zval **arg;
        const unsigned char *in, *inp, *endp;
        unsigned char *out, *outp;
+       unsigned char c;
        int inlen, outlen;
        enum {
                ST_NORMAL,      /* printable text */
@@ -2150,13 +2151,15 @@ PHP_FUNCTION(imap_utf7_decode)
                                break;
                        case ST_DECODE1:
                                outp[1] = UNB64(*inp);
-                               *outp++ |= outp[1] >> 4;
+                               c = outp[1] >> 4;
+                               *outp++ |= c;
                                *outp <<= 4;
                                state = ST_DECODE2;
                                break;
                        case ST_DECODE2:
                                outp[1] = UNB64(*inp);
-                               *outp++ |= outp[1] >> 2;
+                               c = outp[1] >> 2;
+                               *outp++ |= c;
                                *outp <<= 6;
                                state = ST_DECODE3;
                                break;
@@ -2190,6 +2193,7 @@ PHP_FUNCTION(imap_utf7_encode)
        zval **arg;
        const unsigned char *in, *inp, *endp;
        unsigned char *out, *outp;
+       unsigned char c;
        int inlen, outlen;
        enum {
                ST_NORMAL,      /* printable text */
@@ -2273,12 +2277,14 @@ PHP_FUNCTION(imap_utf7_encode)
                                        state = ST_ENCODE1;
                                        break;
                                case ST_ENCODE1:
-                                       *outp++ = B64(*outp | *inp >> 4);
+                                       c = B64(*outp | *inp >> 4);
+                                       *outp++ = c;
                                        *outp = *inp++ << 2;
                                        state = ST_ENCODE2;
                                        break;
                                case ST_ENCODE2:
-                                       *outp++ = B64(*outp | *inp >> 6);
+                                       c = B64(*outp | *inp >> 6);
+                                       *outp++ = c;
                                        *outp++ = B64(*inp++);
                                        state = ST_ENCODE0;
                                case ST_NORMAL: