summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkettenis <>2020-07-14 16:40:04 +0000
committerkettenis <>2020-07-14 16:40:04 +0000
commit4f1ef9d80a0607a37ef931241c14ed2da153094f (patch)
treea62dbebcde803508785290dd6d444aa5a2367de1
parent8d01f37b978865bbd6c1afedc83a5a2e091342ab (diff)
downloadopenbsd-4f1ef9d80a0607a37ef931241c14ed2da153094f.tar.gz
openbsd-4f1ef9d80a0607a37ef931241c14ed2da153094f.tar.bz2
openbsd-4f1ef9d80a0607a37ef931241c14ed2da153094f.zip
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@
-rw-r--r--src/regress/lib/libc/printf/int.c4
-rw-r--r--src/regress/lib/libc/printf/string.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/regress/lib/libc/printf/int.c b/src/regress/lib/libc/printf/int.c
index d6ecb7a98d..5a56c8d50e 100644
--- a/src/regress/lib/libc/printf/int.c
+++ b/src/regress/lib/libc/printf/int.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: int.c,v 1.1 2020/07/09 01:49:15 schwarze Exp $ */ 1/* $OpenBSD: int.c,v 1.2 2020/07/14 16:40:04 kettenis Exp $ */
2/* 2/*
3 * Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org> 3 * Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org>
4 * 4 *
@@ -178,7 +178,7 @@ int
178main(int argc, char *argv[]) 178main(int argc, char *argv[])
179{ 179{
180 int badarg, picky; 180 int badarg, picky;
181 char ch; 181 int ch;
182 182
183 badarg = picky = 0; 183 badarg = picky = 0;
184 while ((ch = getopt(argc, argv, "pv")) != -1) { 184 while ((ch = getopt(argc, argv, "pv")) != -1) {
diff --git a/src/regress/lib/libc/printf/string.c b/src/regress/lib/libc/printf/string.c
index afbc4fc79c..6e65a371a4 100644
--- a/src/regress/lib/libc/printf/string.c
+++ b/src/regress/lib/libc/printf/string.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: string.c,v 1.1 2020/07/08 01:18:04 schwarze Exp $ */ 1/* $OpenBSD: string.c,v 1.2 2020/07/14 16:40:04 kettenis Exp $ */
2/* 2/*
3 * Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org> 3 * Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org>
4 * 4 *
@@ -255,7 +255,7 @@ main(int argc, char *argv[])
255 const wchar_t ws[] = { 0x0421, 0x043e, 0x0444, 0x044f, 0 }; 255 const wchar_t ws[] = { 0x0421, 0x043e, 0x0444, 0x044f, 0 };
256 const wchar_t wsbad[] = { 0x0391, 0xdeef, 0x3c9, 0 }; 256 const wchar_t wsbad[] = { 0x0391, 0xdeef, 0x3c9, 0 };
257 int badarg, picky; 257 int badarg, picky;
258 char ch; 258 int ch;
259 259
260 badarg = picky = 0; 260 badarg = picky = 0;
261 while ((ch = getopt(argc, argv, "pv")) != -1) { 261 while ((ch = getopt(argc, argv, "pv")) != -1) {