# HG changeset patch # User Dave Love # Date 970872166 0 # Node ID 811419e9e769034d270ceb1fdbe8191cd30d5c93 # Parent e268d58044bc26f2d0baa8c33cd916d72b0a01ce (Fbase64_encode_region, Fbase64_encode_string) (Fbase64_decode_region, Fbase64_decode_string): More explicit error messages. diff -r e268d58044bc -r 811419e9e769 src/fns.c --- 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; }