From 5dea098c4cfaecce9ae6586a5a65b55e2cfefa58 Mon Sep 17 00:00:00 2001 From: schwarze Date: Tue, 14 May 2024 00:31:48 +0000 Subject: [PATCH] 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... --- regress/usr.bin/mandoc/db/dbm_dump/dbm_dump.c | 4 ++-- 1 file 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 * @@ -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'); -- 2.20.1