shithub: femtolisp

Download patch

ref: 5df1e1690d92bbe74d89591bcb0c8f4841275bd3
parent: dbead6060a9577e0a013bd98e57d6b592ae4a7e3
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Fri Nov 15 20:26:05 EST 2024

snprint_real: don't use strcpy to shut openbsd up

--- a/print.c
+++ b/print.c
@@ -614,8 +614,10 @@
 			// don't need trailing .
 			if(s[sz-1] == '.')
 				s[--sz] = '\0';
-			if(num_format[1] == 'e')
-				strcpy(s+sz, e);
+			if(num_format[1] == 'e'){
+				while(*e)
+					s[sz++] = *e++;
+			}
 		}
 	}
 }