git: 9f3203c00314 - main - uudecode: correct error message

From: Piotr Pawel Stefaniak <pstef_at_FreeBSD.org>
Date: Mon, 28 Mar 2022 07:21:43 UTC
The branch main has been updated by pstef:

URL: https://cgit.FreeBSD.org/src/commit/?id=9f3203c003144a4ef6309435036f985afe549ff0

commit 9f3203c003144a4ef6309435036f985afe549ff0
Author:     Piotr Pawel Stefaniak <pstef@FreeBSD.org>
AuthorDate: 2021-11-08 14:31:03 +0000
Commit:     Piotr Pawel Stefaniak <pstef@FreeBSD.org>
CommitDate: 2022-03-28 07:01:35 +0000

    uudecode: correct error message
    
    PR:             153276
    Reported by:    David Brennan
---
 usr.bin/uudecode/uudecode.c               | 2 +-
 usr.bin/uuencode/tests/regress.153276.in  | 4 ++++
 usr.bin/uuencode/tests/regress.153276.out | 1 +
 usr.bin/uuencode/tests/regress.sh         | 3 +++
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c
index 6d31d96ad958..707ba27df62e 100644
--- a/usr.bin/uudecode/uudecode.c
+++ b/usr.bin/uudecode/uudecode.c
@@ -353,7 +353,7 @@ uu_decode(void)
 
 #define OUT_OF_RANGE do {						\
 	warnx("%s: %s: character out of range: [%d-%d]",		\
-	    infile, outfile, 1 + ' ', 077 + ' ' + 1);			\
+	    infile, outfile, ' ', 077 + ' ' + 1);			\
 	return (1);							\
 } while (0)
 
diff --git a/usr.bin/uuencode/tests/regress.153276.in b/usr.bin/uuencode/tests/regress.153276.in
new file mode 100644
index 000000000000..d881c8a9389e
--- /dev/null
+++ b/usr.bin/uuencode/tests/regress.153276.in
@@ -0,0 +1,4 @@
+begin 644 153276
+/5&AI<R!I<R!A('1E<W0*
+
+end
diff --git a/usr.bin/uuencode/tests/regress.153276.out b/usr.bin/uuencode/tests/regress.153276.out
new file mode 100644
index 000000000000..b82ee6f61b39
--- /dev/null
+++ b/usr.bin/uuencode/tests/regress.153276.out
@@ -0,0 +1 @@
+uudecode: stdin: /dev/null: character out of range: [32-96]
diff --git a/usr.bin/uuencode/tests/regress.sh b/usr.bin/uuencode/tests/regress.sh
index 6be0ef3cc9b0..630cfb525991 100644
--- a/usr.bin/uuencode/tests/regress.sh
+++ b/usr.bin/uuencode/tests/regress.sh
@@ -7,4 +7,7 @@ REGRESSION_START($1)
 REGRESSION_TEST(`traditional', `uuencode regress.in <${SRCDIR}/regress.in')
 REGRESSION_TEST(`base64', `uuencode -m regress.in <${SRCDIR}/regress.in')
 
+# was uudecode: stdin: /dev/null: character out of range: [33-96]
+REGRESSION_TEST(`153276', `uudecode -o /dev/null < regress.153276.in 2>&1')
+
 REGRESSION_END()