mirror of
https://github.com/troglobit/finit.git
synced 2026-10-26 12:14:37 +00:00
Minor optimization, drop expensive memset() ops
No need to zero out whole buffer for strlcat(), or other string check ops. Also drop a few completely useless memset() calls. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
d43af8c9c1
commit
c0716d7f63
4 files changed
+6
-10
No files matched your search
+2
-2
@@ -260,7 +260,7 @@ void print_banner(const char *heading)
|
||||
if (progress_style == PROGRESS_SILENT)
|
||||
return;
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
buf[0] = 0;
|
||||
strlcat(buf, "\r\e[2K", sizeof(buf));
|
||||
|
||||
if (progress_style == PROGRESS_CLASSIC) {
|
||||
@@ -339,7 +339,7 @@ void printv(const char *fmt, va_list ap)
|
||||
|
||||
delline();
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
buf[0] = 0;
|
||||
len = print_timestamp(buf, sizeof(buf));
|
||||
vsnprintf(&buf[len], sizeof(buf) - len, fmt, ap);
|
||||
|
||||
|
||||
Reference in new issue
Block a user