← Commit list

37a9008f8

Denys Vlasenko
Denys Vlasenko
2019-10-15
SUCCESS Duration: 149s

Subject

brctl: code shrink

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 →

networking/brctl.c+4 -3
@@ -157,7 +157,8 @@ static int show_bridge(const char *name, int need_hdr)
strcpy(filedata, "yes");
fputs(filedata, stdout);
- strcpy(sfx - (sizeof("bridge/")-1), "brif");
+ /* sfx points past "BR/bridge/", turn it into "BR/brif": */
+ sfx[-4] = 'f'; sfx[-3] = '\0';
tabs = 0;
ifaces = opendir(pathbuf);
if (ifaces) {
@@ -472,8 +473,8 @@ static void show_bridge_stp(const char *name)
{
DIR *ifaces;
- /* sfx points past "BR/bridge/", turn it to "BR/brif": */
- strcpy(sfx - 4, "f");
+ /* sfx points past "BR/bridge/", turn it into "BR/brif": */
+ sfx[-4] = 'f'; sfx[-3] = '\0';
ifaces = opendir(pathbuf);
if (ifaces) {
struct dirent *ent;