diff options
| author | Dave Love | 2000-10-06 22:42:46 +0000 |
|---|---|---|
| committer | Dave Love | 2000-10-06 22:42:46 +0000 |
| commit | a90e80bfa2e5506826b500dcb6c75a950e934b62 (patch) | |
| tree | b40842be9cb60e1638b3eca7aa106322f0269d09 /src | |
| parent | 39250ec387bc9c4f06641ec708dde396723f5182 (diff) | |
| download | emacs-a90e80bfa2e5506826b500dcb6c75a950e934b62.tar.gz emacs-a90e80bfa2e5506826b500dcb6c75a950e934b62.zip | |
(Fbase64_encode_region, Fbase64_encode_string)
(Fbase64_decode_region, Fbase64_decode_string): More explicit
error messages.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -3173,7 +3173,7 @@ ARGS are passed as extra arguments to the function.") | |||
| 3173 | return result; | 3173 | return result; |
| 3174 | } | 3174 | } |
| 3175 | 3175 | ||
| 3176 | /* base64 encode/decode functions. | 3176 | /* base64 encode/decode functions (RFC 2045). |
| 3177 | Based on code from GNU recode. */ | 3177 | Based on code from GNU recode. */ |
| 3178 | 3178 | ||
| 3179 | #define MIME_LINE_LENGTH 76 | 3179 | #define MIME_LINE_LENGTH 76 |
| @@ -3296,7 +3296,7 @@ into shorter lines.") | |||
| 3296 | /* The encoding wasn't possible. */ | 3296 | /* The encoding wasn't possible. */ |
| 3297 | if (length > MAX_ALLOCA) | 3297 | if (length > MAX_ALLOCA) |
| 3298 | xfree (encoded); | 3298 | xfree (encoded); |
| 3299 | error ("Base64 encoding failed"); | 3299 | error ("Multibyte character in data for base64 encoding"); |
| 3300 | } | 3300 | } |
| 3301 | 3301 | ||
| 3302 | /* Now we have encoded the region, so we insert the new contents | 3302 | /* Now we have encoded the region, so we insert the new contents |
| @@ -3357,7 +3357,7 @@ into shorter lines.") | |||
| 3357 | /* The encoding wasn't possible. */ | 3357 | /* The encoding wasn't possible. */ |
| 3358 | if (length > MAX_ALLOCA) | 3358 | if (length > MAX_ALLOCA) |
| 3359 | xfree (encoded); | 3359 | xfree (encoded); |
| 3360 | error ("Base64 encoding failed"); | 3360 | error ("Multibyte character in data for base64 encoding"); |
| 3361 | } | 3361 | } |
| 3362 | 3362 | ||
| 3363 | encoded_string = make_unibyte_string (encoded, encoded_length); | 3363 | encoded_string = make_unibyte_string (encoded, encoded_length); |
| @@ -3497,7 +3497,7 @@ If the region can't be decoded, signal an error and don't modify the buffer.") | |||
| 3497 | /* The decoding wasn't possible. */ | 3497 | /* The decoding wasn't possible. */ |
| 3498 | if (length > MAX_ALLOCA) | 3498 | if (length > MAX_ALLOCA) |
| 3499 | xfree (decoded); | 3499 | xfree (decoded); |
| 3500 | error ("Base64 decoding failed"); | 3500 | error ("Invalid base64 data"); |
| 3501 | } | 3501 | } |
| 3502 | 3502 | ||
| 3503 | inserted_chars = decoded_length; | 3503 | inserted_chars = decoded_length; |
| @@ -3555,7 +3555,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string, | |||
| 3555 | if (length > MAX_ALLOCA) | 3555 | if (length > MAX_ALLOCA) |
| 3556 | xfree (decoded); | 3556 | xfree (decoded); |
| 3557 | if (!STRINGP (decoded_string)) | 3557 | if (!STRINGP (decoded_string)) |
| 3558 | error ("Base64 decoding failed"); | 3558 | error ("Invalid base64 data"); |
| 3559 | 3559 | ||
| 3560 | return decoded_string; | 3560 | return decoded_string; |
| 3561 | } | 3561 | } |