Skip to content

Commit

Permalink
clanup this one also
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ortmann committed Oct 7, 2023
1 parent 82911c1 commit 39e4694
Showing 1 changed file with 13 additions and 22 deletions.
35 changes: 13 additions & 22 deletions src/cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -2605,30 +2605,21 @@ char *stripmasktype(int x)

static char *stripmaskname(int x)
{
static char s[161];
int i = 0;
static char s[128];
int i;

s[i] = 0;
if (x & STRIP_COLOR)
i += my_strcpy(s + i, "color, ");
if (x & STRIP_BOLD)
i += my_strcpy(s + i, "bold, ");
if (x & STRIP_REVERSE)
i += my_strcpy(s + i, "reverse, ");
if (x & STRIP_UNDERLINE)
i += my_strcpy(s + i, "underline, ");
if (x & STRIP_ANSI)
i += my_strcpy(s + i, "ansi, ");
if (x & STRIP_BELLS)
i += my_strcpy(s + i, "bells, ");
if (x & STRIP_ORDINARY)
i += my_strcpy(s + i, "ordinary, ");
if (x & STRIP_ITALICS)
i += my_strcpy(s + i, "italics, ");
if (!i)
strcpy(s, "none");
else
if ((i = snprintf(s, sizeof s, "%s%s%s%s%s%s%s%s",
(x & STRIP_COLOR) ? "color, " : "",
(x & STRIP_BOLD) ? "bold, " : "",
(x & STRIP_REVERSE) ? "reverse, " : "",
(x & STRIP_UNDERLINE) ? "underline, " : "",
(x & STRIP_ANSI) ? "ansi, " : "",
(x & STRIP_BELLS) ? "bells, " : "",
(x & STRIP_ORDINARY) ? "ordinary, " : "",
(x & STRIP_ITALICS) ? "italics, " : "")))
s[i - 2] = 0;
else
strcpy(s, "none");
return s;
}

Expand Down

0 comments on commit 39e4694

Please sign in to comment.