[klibc] [klibc:update-dash] dash: [BUILTIN] Remove unnecessary restoration of format string in printf

klibc-bot for Herbert Xu herbert at gondor.apana.org.au
Sat Mar 28 14:48:29 PDT 2020


Commit-ID:  8bd3bf48d7a5893496646bf82325d4fc30d77321
Gitweb:     http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=8bd3bf48d7a5893496646bf82325d4fc30d77321
Author:     Herbert Xu <herbert at gondor.apana.org.au>
AuthorDate: Mon, 27 Oct 2014 15:53:48 +0800
Committer:  Ben Hutchings <ben at decadent.org.uk>
CommitDate: Sat, 28 Mar 2020 21:42:54 +0000

[klibc] dash: [BUILTIN] Remove unnecessary restoration of format string in printf

[ dash commit 7bb413255368e94395237d789f522891093c5774 ]

Currently we try to preserve the format string which is stored in
argv after temporarily modifying it.  This is unnecessary as it's
only ever used once.  This patch gets rid of it.

Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>

---
 usr/dash/bltin/printf.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c
index d49d4454..5cd34a19 100644
--- a/usr/dash/bltin/printf.c
+++ b/usr/dash/bltin/printf.c
@@ -209,7 +209,6 @@ pc:
 				if (print_escape_str(start, param, array,
 						     getstr()))
 					goto out;
-				*fmt = 'b';
 				break;
 			case 'c': {
 				int p = getchr();


More information about the klibc mailing list