aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1998-11-04 10:53:14 +0000
committerKenichi Handa1998-11-04 10:53:14 +0000
commitda1ad4e741771618cc1ec4c4952c46db04924f4f (patch)
tree6417af52c588497af77514b8c0d2178180b1ae96 /src
parent6a0d0ed308e7eef7d1070916fb682532e9ead665 (diff)
downloademacs-da1ad4e741771618cc1ec4c4952c46db04924f4f.tar.gz
emacs-da1ad4e741771618cc1ec4c4952c46db04924f4f.zip
(print_string): Check validity of a character.
(print): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/print.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/print.c b/src/print.c
index ec340e2c91d..3723c79b6dd 100644
--- a/src/print.c
+++ b/src/print.c
@@ -635,7 +635,11 @@ print_string (string, printcharfun)
635 int len; 635 int len;
636 int ch = STRING_CHAR_AND_CHAR_LENGTH (XSTRING (string)->data + i, 636 int ch = STRING_CHAR_AND_CHAR_LENGTH (XSTRING (string)->data + i,
637 size_byte - i, len); 637 size_byte - i, len);
638 638 if (!CHAR_VALID_P (ch, 0))
639 {
640 ch = XSTRING (string)->data[i];
641 len = 1;
642 }
639 PRINTCHAR (ch); 643 PRINTCHAR (ch);
640 i += len; 644 i += len;
641 } 645 }
@@ -1266,7 +1270,10 @@ print (obj, printcharfun, escapeflag)
1266 { 1270 {
1267 c = STRING_CHAR_AND_CHAR_LENGTH (str + i_byte, 1271 c = STRING_CHAR_AND_CHAR_LENGTH (str + i_byte,
1268 size_byte - i_byte, len); 1272 size_byte - i_byte, len);
1269 i_byte += len; 1273 if (CHAR_VALID_P (c, 0))
1274 i_byte += len;
1275 else
1276 c = str[i_byte++];
1270 } 1277 }
1271 else 1278 else
1272 c = str[i_byte++]; 1279 c = str[i_byte++];