summaryrefslogtreecommitdiff
path: root/src/regress/lib
diff options
context:
space:
mode:
authordlg <>2020-03-09 09:29:10 +0000
committerdlg <>2020-03-09 09:29:10 +0000
commitf06e55459ad96981abf401d5ccbb700ef0618af8 (patch)
tree84ab008d9bdfbab52e8963afb5ffeb2e5c6619b6 /src/regress/lib
parent9ad7f732b50e06beb7ceecfd95ddf0814ae3fee2 (diff)
downloadopenbsd-f06e55459ad96981abf401d5ccbb700ef0618af8.tar.gz
openbsd-f06e55459ad96981abf401d5ccbb700ef0618af8.tar.bz2
openbsd-f06e55459ad96981abf401d5ccbb700ef0618af8.zip
cstyle in illumos noticed some weird syntax, which this fixes.
some errx lines in if statements were terminated with commas, which caused the following statement to be considered part of the error handling. while it is bad style, ingo points out it was also a bug which which caused some tests in the code to be skipped. this reminds me of a haiku that Chris Pascoe (cpascoe@) had behind his desk: Also, that comma Should be a semi-colon. Cherry blossoms fall. this was found by Robert Mustacchi when porting the tests to illumos. ok schwarze@ stsp@ thank you robert.
Diffstat (limited to 'src/regress/lib')
-rw-r--r--src/regress/lib/libc/locale/mbrtowc/test_mbrtowc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/regress/lib/libc/locale/mbrtowc/test_mbrtowc.c b/src/regress/lib/libc/locale/mbrtowc/test_mbrtowc.c
index 5926d25fd0..7455f68439 100644
--- a/src/regress/lib/libc/locale/mbrtowc/test_mbrtowc.c
+++ b/src/regress/lib/libc/locale/mbrtowc/test_mbrtowc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: test_mbrtowc.c,v 1.2 2017/07/27 15:08:37 bluhm Exp $ */ 1/* $OpenBSD: test_mbrtowc.c,v 1.3 2020/03/09 09:29:10 dlg Exp $ */
2/* 2/*
3 * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> 3 * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4 * 4 *
@@ -57,7 +57,7 @@ main(void)
57 onetest("CSI", "\233", 2, 0, 1, L'\233'); 57 onetest("CSI", "\233", 2, 0, 1, L'\233');
58 58
59 if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL) 59 if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL)
60 errx(1, "setlocale(UTF-8) failed"), 60 errx(1, "setlocale(UTF-8) failed");
61 61
62 onetest("NUL", "", 0, 0, -2, WEOF); 62 onetest("NUL", "", 0, 0, -2, WEOF);
63 onetest("NUL", "", 8, 0, 0, L'\0'); 63 onetest("NUL", "", 8, 0, 0, L'\0');
@@ -72,12 +72,12 @@ main(void)
72 onetest("U+CFFF", "\277", 8, 0, 1, 0xcfff); 72 onetest("U+CFFF", "\277", 8, 0, 1, 0xcfff);
73 73
74 if (setlocale(LC_CTYPE, "POSIX") == NULL) 74 if (setlocale(LC_CTYPE, "POSIX") == NULL)
75 errx(1, "setlocale(POSIX) failed"), 75 errx(1, "setlocale(POSIX) failed");
76 76
77 onetest("0xff", "\277", 2, 0, 1, L'\277'); 77 onetest("0xff", "\277", 2, 0, 1, L'\277');
78 78
79 if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL) 79 if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL)
80 errx(1, "second setlocale(UTF-8) failed"), 80 errx(1, "second setlocale(UTF-8) failed");
81 81
82 onetest("U+13000", "\360\223\200\200", 8, 0, 4, 0x13000); 82 onetest("U+13000", "\360\223\200\200", 8, 0, 4, 0x13000);
83 83