From a1aefa45eb1fc75eaee170b69482223f5a408d1d Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Tue, 14 Jul 2020 16:40:05 +0000 Subject: getopt(3) returns an int so don't use a char to store its return value. Makes the test work on architectures where char is unsigned. ok deraadt@, millert@ --- regress/lib/libc/printf/int.c | 4 ++-- regress/lib/libc/printf/string.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'regress/lib') diff --git a/regress/lib/libc/printf/int.c b/regress/lib/libc/printf/int.c index d6ecb7a98de..5a56c8d50ea 100644 --- a/regress/lib/libc/printf/int.c +++ b/regress/lib/libc/printf/int.c @@ -1,4 +1,4 @@ -/* $OpenBSD: int.c,v 1.1 2020/07/09 01:49:15 schwarze Exp $ */ +/* $OpenBSD: int.c,v 1.2 2020/07/14 16:40:04 kettenis Exp $ */ /* * Copyright (c) 2020 Ingo Schwarze * @@ -178,7 +178,7 @@ int main(int argc, char *argv[]) { int badarg, picky; - char ch; + int ch; badarg = picky = 0; while ((ch = getopt(argc, argv, "pv")) != -1) { diff --git a/regress/lib/libc/printf/string.c b/regress/lib/libc/printf/string.c index afbc4fc79c2..6e65a371a47 100644 --- a/regress/lib/libc/printf/string.c +++ b/regress/lib/libc/printf/string.c @@ -1,4 +1,4 @@ -/* $OpenBSD: string.c,v 1.1 2020/07/08 01:18:04 schwarze Exp $ */ +/* $OpenBSD: string.c,v 1.2 2020/07/14 16:40:04 kettenis Exp $ */ /* * Copyright (c) 2020 Ingo Schwarze * @@ -255,7 +255,7 @@ main(int argc, char *argv[]) const wchar_t ws[] = { 0x0421, 0x043e, 0x0444, 0x044f, 0 }; const wchar_t wsbad[] = { 0x0391, 0xdeef, 0x3c9, 0 }; int badarg, picky; - char ch; + int ch; badarg = picky = 0; while ((ch = getopt(argc, argv, "pv")) != -1) { -- cgit v1.2.3