]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_rfc2047.c
mts/smtp/smtp.c: Replace int with bool.
[nmh] / sbr / fmt_rfc2047.c
index 2f2c3c4f47cb7cb6e9ee012e4aff2dcc60be8b40..8c799e14c77b1197c684ab446c163df018c31b66 100644 (file)
@@ -11,7 +11,7 @@
 #  include <iconv.h>
 #endif
 
-static signed char hexindex[] = {
+static const signed char hexindex[] = {
     -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
     -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
     -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
@@ -30,7 +30,7 @@ static signed char hexindex[] = {
     -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
 };
 
-static signed char index_64[128] = {
+static const signed char index_64[128] = {
     -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
     -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
     -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
@@ -52,7 +52,7 @@ decode_qp (unsigned char byte1, unsigned char byte2)
 {
     if (hexindex[byte1] == -1 || hexindex[byte2] == -1)
        return -1;
-    return (hexindex[byte1] << 4 | hexindex[byte2]);
+    return hexindex[byte1] << 4 | hexindex[byte2];
 }
 
 /* Check if character is linear whitespace */
@@ -126,7 +126,7 @@ decode_rfc2047 (char *str, char *dst, size_t dstlen)
        equals_pending = 1;     /* we have a '=' pending */
 
        /* Check for initial =? */
-       if (*p == '=' && p[1] && p[1] == '?' && p[2]) {
+       if (*p == '=' && p[1] == '?' && p[2]) {
            startofmime = p + 2;
 
            /* Scan ahead for the next '?' character */
@@ -229,7 +229,7 @@ decode_rfc2047 (char *str, char *dst, size_t dstlen)
            if (use_iconv) {
                saveq = q;
                savedstlen = dstlen;
-                q = convbuf = (char *) mh_xmalloc(endofmime - startofmime);
+                q = convbuf = mh_xmalloc(endofmime - startofmime);
             }
 /* ADDCHR2 is for adding characters when q is or might be convbuf:
  * in this case on buffer-full we want to run iconv before returning.