Using sprintf to copy one character to the output buffer is overkill.

Signed-off-by: Petr Tesarik <[email protected]>
---
 makedumpfile.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index 261e1ad..a98258c 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -3892,12 +3892,12 @@ dump_log_entry(char *logptr, int fp)
                }
 
                if (isprint(*p) || isspace(*p))
-                       bufp =+ sprintf(bufp, "%c", *p);
+                       *bufp++ = *p;
                else
                        bufp += sprintf(bufp, "\\x%02x", *p);
        }
 
-       bufp += sprintf(bufp, "\n");
+       *bufp++ = '\n';
 
        if (write(info->fd_dumpfile, buf, bufp - buf) < 0)
                return FALSE;
-- 
1.8.4.5


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to