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

klibc-bot for Herbert Xu herbert at gondor.apana.org.au
Thu Jan 24 19:15:26 PST 2019

Commit-ID:  c0a8ac18981f20b315b43a5a3f8fbe64e1cbc749
Gitweb:     http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=c0a8ac18981f20b315b43a5a3f8fbe64e1cbc749
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: Fri, 25 Jan 2019 02:57:21 +0000

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

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,
 					goto out;
-				*fmt = 'b';
 			case 'c': {
 				int p = getchr();

More information about the klibc mailing list