blob: b5b5e04f8eba288b9054d27bc5d753c68826a630 (
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
32
33
34
35
|
$NetBSD: patch-ah,v 1.3 2000/12/08 01:33:42 wiz Exp $
--- Common/clanstring.h.orig Sun Jul 11 13:14:05 1999
+++ Common/clanstring.h
@@ -65,6 +65,8 @@
#ifndef WIN32
#include <ctype.h>
+#include <stdio.h>
+#include <sys/param.h>
#endif
#ifdef __BEOS__
@@ -141,9 +143,12 @@
{
char buf[25];
buf[0]=0;
+ int precision=4;
+#if (defined(BSD) && BSD >= 199306)
+ snprintf(buf, sizeof buf, "%.*f", precision, (double)_float_number);
+#else
int decimal, sign;
- int precision=4;
char temp;
float float_number = _float_number;
@@ -174,6 +179,7 @@
strcat(buf, &float_buffer[decimal]);
copy_strings:
+#endif
int len=0;
if (prefix!=NULL) len=strlen(prefix);
|