summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-01-12 02:52:02 +0000
committerJeremy Allison <jra@samba.org>2000-01-12 02:52:02 +0000
commit50be4e1f34e8ceb9f516c0755edf77bb32f03475 (patch)
tree702b233a334b23d84ebf777408206068d0698ad7 /source3/lib
parent8f4e672094546e9a3e06b8c2da0607809ecb2cab (diff)
downloadsamba-50be4e1f34e8ceb9f516c0755edf77bb32f03475.tar.gz
samba-50be4e1f34e8ceb9f516c0755edf77bb32f03475.tar.bz2
samba-50be4e1f34e8ceb9f516c0755edf77bb32f03475.zip
Fix problems with broken libc fvct returns.
Jeremy. (This used to be commit 6b61f2fe66a62082fdab998ec7bbb1184b9583d7)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/snprintf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/lib/snprintf.c b/source3/lib/snprintf.c
index f149d3e667..5409598548 100644
--- a/source3/lib/snprintf.c
+++ b/source3/lib/snprintf.c
@@ -680,13 +680,20 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
r_length = strlen(result);
+ /*
+ * Fix broken fcvt implementation returns..
+ */
+
if (r_length == 0)
{
result[0] = '0';
result[1] = '\0';
r_length = 1;
}
-
+
+ if ( r_length < dec_pt )
+ dec_pt = r_length;
+
if (dec_pt <= 0)
{
iplace = 1;