← Commit list

3395e2a8e

Denys Vlasenko
Denys Vlasenko
2019-03-26
SUCCESS Duration: 150s

Subject

ts: replace overlapping strcpy with shorter code

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

miscutils/ts.c+2 -1
@@ -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