changeset 31865:dd9aa7db6710

(base64_encode_1): Fix last change.
author Dave Love <fx@gnu.org>
date Mon, 25 Sep 2000 09:23:41 +0000
parents 3df9d3316990
children 7c21fe4f9137
files src/fns.c
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/fns.c	Mon Sep 25 09:23:32 2000 +0000
+++ b/src/fns.c	Mon Sep 25 09:23:41 2000 +0000
@@ -3377,7 +3377,7 @@
 {
   int counter = 0, i = 0;
   char *e = to;
-  unsigned char c;
+  int c;
   unsigned int value;
   int bytes;
 
@@ -3386,9 +3386,9 @@
       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 @@
       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 @@
       if (multibyte)
 	{
 	  c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
-	  i += bytes;
+	  if (bytes > 1)
+	    return -1;
+	  i++;
 	}
       else
 	c = from[i++];