summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2024-05-14 00:31:49 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2024-05-14 00:31:49 +0000
commitd3e84876ac272c9191b62255e110807057f5d155 (patch)
tree6e8586fe5c816b5bc86835c9f6e307821b4ddb3d
parentdf163759c73451263aba095b0e6fe85bef9854b6 (diff)
fix a char signedness bug such that this testing code becomes able
to display the contents of databases containing UTF-8 strings on signed char architectures: for example on i386 and amd64, UTF-8 bytes are negative...
-rw-r--r--regress/usr.bin/mandoc/db/dbm_dump/dbm_dump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regress/usr.bin/mandoc/db/dbm_dump/dbm_dump.c b/regress/usr.bin/mandoc/db/dbm_dump/dbm_dump.c
index 22761e2c298..f4e967e0237 100644
--- a/regress/usr.bin/mandoc/db/dbm_dump/dbm_dump.c
+++ b/regress/usr.bin/mandoc/db/dbm_dump/dbm_dump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dbm_dump.c,v 1.2 2016/08/30 22:20:03 schwarze Exp $ */
+/* $OpenBSD: dbm_dump.c,v 1.3 2024/05/14 00:31:48 schwarze Exp $ */
/*
* Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -196,7 +196,7 @@ dump_str(const char **cp)
printf("(NULL)");
return;
}
- if (**cp <= (char)NAME_MASK) {
+ if ((unsigned char)**cp <= NAME_MASK) {
putchar('[');
if (**cp & NAME_FILE)
putchar('f');