shithub: treason

Download patch

ref: 0a0e38c97f48a3dc902b71eaf31905a63a832232
parent: 2f4e78d223b2916ec92874e533d1a0308b065200
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Sep 15 10:17:48 EDT 2020

str2fmt: don't crash when string isn't set

--- a/misc.c
+++ b/misc.c
@@ -19,7 +19,7 @@
 {
 	int i;
 
-	for(i = 0; i < nelem(fmts) && strcmp(fmts[i], s) != 0; i++);
+	for(i = 0; i < nelem(fmts) && fmts[i] != nil && strcmp(fmts[i], s) != 0; i++);
 
 	return i < nelem(fmts) ? i : -1;
 }