shithub: riscv

Download patch

ref: 02287a23f0e71b1d524c853adc0ea24671522da2
parent: ec70fc64ad6e5072f83ce672f20ae200055fe0eb
author: stanley lieber <stanley.lieber@gmail.com>
date: Thu Sep 22 21:36:44 EDT 2011

mothra: do not crash on an invalid j command

--- a/sys/src/cmd/mothra/mothra.c
+++ b/sys/src/cmd/mothra/mothra.c
@@ -541,7 +541,7 @@
 		break;
 	case 'j':
 		s=arg(s);
-		if(*s)
+		if(atoi(s) <= nwww())
 			geturl(www(atoi(s)-1)->url->fullname, GET, 0, 0, 0);
 		else
 			message("no url selected");
--