From 6a06c02f213c9b13cf47e983f1dfd64b1ca178d9 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 16 Oct 1993 14:47:43 +0000 Subject: [PATCH] (main): When argc == 1, don't try to xmalloc (0). --- src/pr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.11.4.GIT