summaryrefslogtreecommitdiffstats
path: root/source/ap/ksh93/patches/ksh-20120801-roundit.patch
blob: 015bc85cd8c183d77ef525c2caed5c210469cf9a (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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;
 				}
 			}