summaryrefslogtreecommitdiff
path: root/source3/lib/snprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/snprintf.c')
-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;