projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f370a66
)
ts: replace overlapping strcpy with shorter code
author
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 26 Mar 2019 10:41:35 +0000
(11:41 +0100)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 26 Mar 2019 10:41:35 +0000
(11:41 +0100)
function old new delta
ts_main 401 398 -3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/ts.c
patch
|
blob
|
history
diff --git
a/miscutils/ts.c
b/miscutils/ts.c
index c389ab89a6f3895415ebb69cb6bd47687e13765d..a2823721caab1d5452f0e0d520671fb65645338e 100644
(file)
--- a/
miscutils/ts.c
+++ b/
miscutils/ts.c
@@
-42,7
+42,8
@@
int ts_main(int argc UNUSED_PARAM, char **argv)
frac = is_suffixed_with(fmt_dt2str, "%.s");
if (frac) {
frac++;
- strcpy(frac, frac + 1);
+ frac[0] = frac[1];
+ frac[1] = '\0';
}
#define date_buf bb_common_bufsiz1