changeset 32234:811419e9e769

(Fbase64_encode_region, Fbase64_encode_string) (Fbase64_decode_region, Fbase64_decode_string): More explicit error messages.
author Dave Love <fx@gnu.org>
date Fri, 06 Oct 2000 22:42:46 +0000
parents e268d58044bc
children 751db8b296e8
files src/fns.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/fns.c	Fri Oct 06 22:19:23 2000 +0000
+++ b/src/fns.c	Fri Oct 06 22:42:46 2000 +0000
@@ -3173,7 +3173,7 @@
   return result;
 }
 
-/* base64 encode/decode functions.
+/* base64 encode/decode functions (RFC 2045).
    Based on code from GNU recode. */
 
 #define MIME_LINE_LENGTH 76
@@ -3296,7 +3296,7 @@
       /* The encoding wasn't possible. */
       if (length > MAX_ALLOCA)
 	xfree (encoded);
-      error ("Base64 encoding failed");
+      error ("Multibyte character in data for base64 encoding");
     }
 
   /* Now we have encoded the region, so we insert the new contents
@@ -3357,7 +3357,7 @@
       /* The encoding wasn't possible. */
       if (length > MAX_ALLOCA)
 	xfree (encoded);
-      error ("Base64 encoding failed");
+      error ("Multibyte character in data for base64 encoding");
     }
 
   encoded_string = make_unibyte_string (encoded, encoded_length);
@@ -3497,7 +3497,7 @@
       /* The decoding wasn't possible. */
       if (length > MAX_ALLOCA)
 	xfree (decoded);
-      error ("Base64 decoding failed");
+      error ("Invalid base64 data");
     }
 
   inserted_chars = decoded_length;
@@ -3555,7 +3555,7 @@
   if (length > MAX_ALLOCA)
     xfree (decoded);
   if (!STRINGP (decoded_string))
-    error ("Base64 decoding failed");
+    error ("Invalid base64 data");
 
   return decoded_string;
 }