diff options
| author | Dave Love <fx@gnu.org> | 2000-09-25 09:23:53 +0000 |
|---|---|---|
| committer | Dave Love <fx@gnu.org> | 2000-09-25 09:23:53 +0000 |
| commit | 844eb643e45887a54d5ad5edd6ced1de0b82e5ab (patch) | |
| tree | 14f754d2c299c28cd409c794c267c2808aa8fb0e /src/fns.c | |
| parent | 2e636f9d4814c7da977ab8581ab5e8b6b994d903 (diff) | |
| download | emacs-844eb643e45887a54d5ad5edd6ced1de0b82e5ab.tar.gz | |
(base64_encode_1): Fix last change.
Diffstat (limited to 'src/fns.c')
| -rw-r--r-- | src/fns.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/fns.c b/src/fns.c index e46159fd63c..fce3d728a3a 100644 --- 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++]; |
