mirror of
https://github.com/systemd/systemd.git
synced 2025-01-26 14:04:03 +03:00
manager: use more stpcpy()
This commit is contained in:
parent
99d680acf1
commit
5052495bba
@ -230,32 +230,26 @@ static void draw_cylon(char buffer[], size_t buflen, unsigned width, unsigned po
|
||||
memset(p, ' ', pos-2);
|
||||
p += pos-2;
|
||||
}
|
||||
memcpy(p, ANSI_RED_ON, strlen(ANSI_RED_ON));
|
||||
p += strlen(ANSI_RED_ON);
|
||||
p = stpcpy(p, ANSI_RED_ON);
|
||||
*p++ = '*';
|
||||
}
|
||||
|
||||
if (pos > 0 && pos <= width) {
|
||||
memcpy(p, ANSI_HIGHLIGHT_RED_ON, strlen(ANSI_HIGHLIGHT_RED_ON));
|
||||
p += strlen(ANSI_HIGHLIGHT_RED_ON);
|
||||
p = stpcpy(p, ANSI_HIGHLIGHT_RED_ON);
|
||||
*p++ = '*';
|
||||
}
|
||||
|
||||
memcpy(p, ANSI_HIGHLIGHT_OFF, strlen(ANSI_HIGHLIGHT_OFF));
|
||||
p += strlen(ANSI_HIGHLIGHT_OFF);
|
||||
p = stpcpy(p, ANSI_HIGHLIGHT_OFF);
|
||||
|
||||
if (pos < width) {
|
||||
memcpy(p, ANSI_RED_ON, strlen(ANSI_RED_ON));
|
||||
p += strlen(ANSI_RED_ON);
|
||||
p = stpcpy(p, ANSI_RED_ON);
|
||||
*p++ = '*';
|
||||
if (pos < width-1) {
|
||||
memset(p, ' ', width-1-pos);
|
||||
p += width-1-pos;
|
||||
}
|
||||
memcpy(p, ANSI_HIGHLIGHT_OFF, strlen(ANSI_HIGHLIGHT_OFF));
|
||||
p += strlen(ANSI_HIGHLIGHT_OFF);
|
||||
p = stpcpy(p, ANSI_HIGHLIGHT_OFF);
|
||||
}
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
static void manager_print_jobs_in_progress(Manager *m) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user