]> git.eshelyaron.com Git - emacs.git/commitdiff
(base64_encode_1): Fix last change.
authorDave Love <fx@gnu.org>
Mon, 25 Sep 2000 09:23:53 +0000 (09:23 +0000)
committerDave Love <fx@gnu.org>
Mon, 25 Sep 2000 09:23:53 +0000 (09:23 +0000)
src/ChangeLog
src/fns.c

index 97235b593ec0182f115024cffc3f02b6e96db029..da4dc9c21c5d9b71240ee6624d09e93c0e49130a 100644 (file)
@@ -1,3 +1,7 @@
+2000-09-24  Dave Love  <fx@gnu.org>
+
+       * fns.c (base64_encode_1): Fix last change.
+
 2000-09-22  Gerd Moellmann  <gerd@gnu.org>
 
        * dispnew.c (enable_glyph_matrix_rows): Remove xasserts.
index e46159fd63ccffa226d1b568282064b31fe73366..fce3d728a3ac4cc4a0617c16f8476d0c504b778c 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -3377,7 +3377,7 @@ base64_encode_1 (from, to, length, line_break, multibyte)
 {
   int counter = 0, i = 0;
   char *e = to;
-  unsigned char c;
+  int c;
   unsigned int value;
   int bytes;
 
@@ -3386,9 +3386,9 @@ base64_encode_1 (from, to, length, line_break, multibyte)
       if (multibyte)
        {
          c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
-         if (!SINGLE_BYTE_CHAR_P (c))
+         if (bytes > 1)
            return -1;
-         i += bytes;
+         i++;
        }
       else
        c = from[i++];
@@ -3424,7 +3424,9 @@ base64_encode_1 (from, to, length, line_break, multibyte)
       if (multibyte)
        {
          c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
-         i += bytes;
+         if (bytes > 1)
+           return -1;
+         i++;
        }
       else
        c = from[i++];
@@ -3444,7 +3446,9 @@ base64_encode_1 (from, to, length, line_break, multibyte)
       if (multibyte)
        {
          c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
-         i += bytes;
+         if (bytes > 1)
+           return -1;
+         i++;
        }
       else
        c = from[i++];