summaryrefslogtreecommitdiff
path: root/src/pr.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-10-16 14:47:43 +0000
committerJim Meyering <jim@meyering.net>1993-10-16 14:47:43 +0000
commit6a06c02f213c9b13cf47e983f1dfd64b1ca178d9 (patch)
tree7130c5ddbcbb540aa15b39ff9f1774bfee7f29e5 /src/pr.c
parent20905f2c93b659dc8908044132b8336439d8e8ee (diff)
downloadcoreutils-6a06c02f213c9b13cf47e983f1dfd64b1ca178d9.tar.xz
(main): When argc == 1, don't try to xmalloc (0).
Diffstat (limited to 'src/pr.c')
-rw-r--r--src/pr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pr.c b/src/pr.c
index 7208f11f2..3451fa38b 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -469,7 +469,9 @@ main (argc, argv)
program_name = argv[0];
n_files = 0;
- file_names = (char **) xmalloc ((argc - 1) * sizeof (char *));
+ file_names = (argc > 1
+ ? (char **) xmalloc ((argc - 1) * sizeof (char *))
+ : NULL);
while (1)
{