diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-07-14 16:40:05 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-07-14 16:40:05 +0000 |
commit | a1aefa45eb1fc75eaee170b69482223f5a408d1d (patch) | |
tree | f8cbcc37ecbcd43ae0cfb992adf9c40dfc37499f /regress/lib/libc/printf | |
parent | 1536ba3241baaf6d44ff25926b7367faca75f180 (diff) |
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@
Diffstat (limited to 'regress/lib/libc/printf')
-rw-r--r-- | regress/lib/libc/printf/int.c | 4 | ||||
-rw-r--r-- | regress/lib/libc/printf/string.c | 4 |
2 files changed, 4 insertions, 4 deletions
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 <schwarze@openbsd.org> * @@ -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 <schwarze@openbsd.org> * @@ -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) { |