From 6acb55326d7457c295f0527272e143adb7ba7fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Wed, 29 Mar 2000 14:15:46 -0800 Subject: [PATCH] bugfix for HP-UX Rev: src/modules/sprintf/sprintf.c:1.62 --- src/modules/sprintf/sprintf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/sprintf/sprintf.c b/src/modules/sprintf/sprintf.c index ac3f0b0eaa..ed28e3d30c 100644 --- a/src/modules/sprintf/sprintf.c +++ b/src/modules/sprintf/sprintf.c @@ -102,7 +102,7 @@ */ #include "global.h" -RCSID("$Id: sprintf.c,v 1.61 2000/03/29 05:17:44 hubbe Exp $"); +RCSID("$Id: sprintf.c,v 1.62 2000/03/29 22:15:46 hubbe Exp $"); #include "error.h" #include "array.h" #include "svalue.h" @@ -1196,7 +1196,9 @@ static void low_pike_sprintf(struct format_stack *fs, if(fs->fsp->precision<0) { double m=pow(10.0, (double)fs->fsp->precision); tf=RINT(tf*m)/m; - } + } else if (fs->fsp->precision==0) { + tf=RINT(tf); + } sprintf(x,buffer,1,fs->fsp->precision<0?0:fs->fsp->precision,tf); fs->fsp->len=strlen(x); -- GitLab