[openssh-commits] [openssh] 01/01: remove unused upper-case const strings in fmtfp

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Apr 6 14:34:31 AEST 2023


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 2138f6be595ca106fe4805a1e3ab9c4d8acc697b
Author: Damien Miller <djm at mindrot.org>
Date:   Thu Apr 6 14:33:10 2023 +1000

    remove unused upper-case const strings in fmtfp
    
    no float format that uses upper-case is supported nor are hex floats.
    ok dtucker
---
 openbsd-compat/bsd-snprintf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c
index 0d23a86c..97892adb 100644
--- a/openbsd-compat/bsd-snprintf.c
+++ b/openbsd-compat/bsd-snprintf.c
@@ -714,7 +714,9 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen,
 	int fplace = 0;
 	int padlen = 0; /* amount to pad */
 	int zpadlen = 0;
+#if 0
 	int caps = 0;
+#endif
 	int idx;
 	double intpart;
 	double fracpart;
@@ -776,8 +778,7 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen,
 		idx = (int) ((temp -intpart +0.05)* 10.0);
 		/* idx = (int) (((double)(temp*0.1) -intpart +0.05) *10.0); */
 		/* printf ("%llf, %f, %x\n", temp, intpart, idx); */
-		iconvert[iplace++] =
-			(caps? "0123456789ABCDEF":"0123456789abcdef")[idx];
+		iconvert[iplace++] = "0123456789"[idx];
 	} while (intpart && (iplace < 311));
 	if (iplace == 311) iplace--;
 	iconvert[iplace] = 0;
@@ -791,8 +792,7 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen,
 			idx = (int) ((temp -fracpart +0.05)* 10.0);
 			/* idx = (int) ((((temp/10) -fracpart) +0.05) *10); */
 			/* printf ("%lf, %lf, %ld\n", temp, fracpart, idx ); */
-			fconvert[fplace++] =
-			(caps? "0123456789ABCDEF":"0123456789abcdef")[idx];
+			fconvert[fplace++] = "0123456789"[idx];
 		} while(fracpart && (fplace < 311));
 		if (fplace == 311) fplace--;
 	}

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list