[hackers] [tabbed][PATCH] don't assume non-null argv[0]

From: NRK <nrk_AT_disroot.org>
Date: Wed, 5 Oct 2022 14:30:09 +0600

---
 xembed.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/xembed.c b/xembed.c
index cbb0e97..0066d04 100644
--- a/xembed.c
+++ b/xembed.c
_AT_@ -15,7 +15,8 @@ main(int argc, char *argv[])
 	pid_t pgrp, tcpgrp;
 
 	if (argc < 3) {
-		fprintf(stderr, "usage: %s flag cmd ...\n", argv[0]);
+		fprintf(stderr, "usage: %s flag cmd ...\n",
+		        argc > 0 ? argv[0] : "xembed");
 		return 2;
 	}
 
-- 
2.35.1
Received on Wed Oct 05 2022 - 10:30:09 CEST

This archive was generated by hypermail 2.3.0 : Wed Oct 05 2022 - 10:36:40 CEST