summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2022-09-25 21:24:30 +0900
committernagachika <nagachika@ruby-lang.org>2022-09-25 21:24:30 +0900
commite46532feafadef252682794c941180df72483c19 (patch)
tree6db8b46f28b7c72e784868e8b1b07c61a81c30f8 /ext
parentd1b36c827036765ab68c88ab4315a26a220d5f06 (diff)
merge revision(s) cf7d07570f50ef9c16007019afcff11ba6500d70: [Backport #18938]
Dump non-ASCII char as unsigned Non-ASCII code may be negative on platforms plain char is signed. --- ext/objspace/objspace_dump.c | 2 +- test/objspace/test_objspace.rb | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-)
Diffstat (limited to 'ext')
-rw-r--r--ext/objspace/objspace_dump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c
index cf7acb5c6f..47081754c9 100644
--- a/ext/objspace/objspace_dump.c
+++ b/ext/objspace/objspace_dump.c
@@ -141,7 +141,7 @@ dump_append_sizet(struct dump_config *dc, const size_t number)
}
static void
-dump_append_c(struct dump_config *dc, char c)
+dump_append_c(struct dump_config *dc, unsigned char c)
{
if (c <= 0x1f) {
const unsigned int width = (sizeof(c) * CHAR_BIT / 4) + 5;