ksh/SOURCES/ksh-20120801-roundit.patch
2021-09-09 19:47:05 +00:00

13 lines
512 B
Diff

diff -up ksh-20120801/src/lib/libast/sfio/sfcvt.c.rounditgood ksh-20120801/src/lib/libast/sfio/sfcvt.c
--- ksh-20120801/src/lib/libast/sfio/sfcvt.c.rounditgood 2014-02-27 16:45:54.630161032 +0100
+++ ksh-20120801/src/lib/libast/sfio/sfcvt.c 2014-02-27 16:45:54.658161205 +0100
@@ -491,7 +491,7 @@ int format; /* conversion format */
*decpt += 1;
if(!(format&SFFMT_EFORMAT))
{ /* add one more 0 for %f precision */
- ep[-1] = '0';
+ if(ep-sp>1) ep[-1] = '0';
ep += 1;
}
}