shithub: rd

Download patch

ref: 05bd68a784ff9ed57439a16f8449444229ed16fc
parent: eb6f11c7f647a18f6fef72c0687c5845130876bb
author: Yaroslav K <yarikos@gmail.com>
date: Sat Aug 23 14:07:43 EDT 2025

getsnarfn: sync with legacy

--- a/wsys.c
+++ b/wsys.c
@@ -104,13 +104,12 @@
 	i = 0;
 	seek(snarffd, 0, 0);
 	while((n = read(snarffd, buf, sizeof(buf))) > 0){
-		s = erealloc(s, i+n+1);	// an extra byte for the terminating zero
+		s = erealloc(s, i+n+1);
 		memmove(s+i, buf, n);
 		i += n;
 	}
 	s[i] = 0;
-	i++;
-	*pnb = i;
+	*pnb = i+1;	// with the terminating zero
 	return s;
 }
 
--