summaryrefslogtreecommitdiff
path: root/src/printf.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-11-23 02:34:31 +0000
committerJim Meyering <jim@meyering.net>1996-11-23 02:34:31 +0000
commit38da840313efebc6b834cc82cc6dc397344c54b3 (patch)
tree26fbdd2bb090dd16e26e67b84379cb38e49475b9 /src/printf.c
parentb36e061e8a332941af6d135334e64393c6910db0 (diff)
downloadcoreutils-38da840313efebc6b834cc82cc6dc397344c54b3.tar.xz
(main): Warn if excess arguments are ignored.
E.g., printf foo bar now ignores the single non-format argument, bar.
Diffstat (limited to 'src/printf.c')
-rw-r--r--src/printf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/printf.c b/src/printf.c
index da24106a9..7ac13a5d6 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -160,6 +160,9 @@ main (int argc, char **argv)
}
while (args_used > 0 && argc > 0);
+ if (argc > 0)
+ error (0, 0, _("warning: excess arguments have been ignored"));
+
exit (exit_status);
}