summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pr.c b/src/pr.c
index 14a368b6c..1c32e8c81 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -1168,6 +1168,12 @@ getoptnum (char const *n_str, int min, int *num, char const *err)
static void
getoptarg (char *arg, char switch_char, char *character, int *number)
{
+ if (!*arg)
+ {
+ error (0, 0, _("'-%c': Invalid argument: %s"), switch_char, quote (arg));
+ usage (EXIT_FAILURE);
+ }
+
if (!ISDIGIT (*arg))
*character = *arg++;
if (*arg)