shithub: riscv

Download patch

ref: 3fbcc5f4105f6add14d705ba46b684085e7e4e79
parent: b80975da8b71c883c4aa578777e58b6c0c0821fb
author: kvik <[email protected]>
date: Mon Nov 16 06:45:05 EST 2020

ptrap: fail if invoked with no arguments

--- a/sys/src/cmd/ptrap.c
+++ b/sys/src/cmd/ptrap.c
@@ -356,7 +356,7 @@
 	default: usage();
 	}ARGEND;
 
-	if(argc % 2) usage();
+	if(argc == 0 || argc % 2) usage();
 	for(i = 0; i < argc; i += 2){
 		f = emalloc9p(sizeof(PFilter));
 		f->name = strdup(argv[i]);