shithub: pdffs

Download patch

ref: 9a3fed882c22cb37c58cbfda5eab260410bb274d
parent: b2307140ac624a7a3ab9a84b761031f5ead84888
author: Noam Preil <noam@pixelhero.dev>
date: Tue Sep 6 22:49:11 EDT 2022

parse: I'm a dumbass sometimes

--- a/string.c
+++ b/string.c
@@ -134,8 +134,8 @@
 	}
 
 	if(c >= 0 && (o = malloc(sizeof(*o))) != nil){
-		sz += 1;
-		if((r = realloc(s, sz)) == nil)
+		maxsz = sz+1;
+		if((r = realloc(s, maxsz)) == nil)
 				goto err;
 		s = r;
 		s[sz] = 0;