summaryrefslogtreecommitdiff
path: root/graphics/clanlib/patches/patch-ah
blob: 41393fb93061ca35a2bee942e59c0a03fb2c49a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$NetBSD: patch-ah,v 1.2 1999/11/30 13:24:47 rh Exp $

--- Common/clanstring.h.orig	Sun Jul 11 13:14:05 1999
+++ Common/clanstring.h	Tue Nov 30 10:28:01 1999
@@ -65,6 +65,8 @@
 
 #ifndef WIN32
 #include <ctype.h>
+#include <stdio.h>
+#include <sys/param.h>
 #endif
 
 #ifdef __BEOS__
@@ -148,6 +150,9 @@
 
 		float float_number = _float_number;
 
+#if (defined(BSD) && BSD >= 199306)
+		snprintf(buf, sizeof buf, "%.*f", precision, (double)_float_number);
+#else
 		const char *_float_buffer = fcvt(
 			float_number,
 			precision,
@@ -172,6 +177,7 @@
 
 		strcat(buf, ".");
 		strcat(buf, &float_buffer[decimal]);
+#endif
 
 	copy_strings:
 		int len=0;