chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
99d680a
)
manager: use more stpcpy()
author
Michal Schmidt
<mschmidt@redhat.com>
Tue, 5 Mar 2013 14:46:37 +0000
(15:46 +0100)
committer
Michal Schmidt
<mschmidt@redhat.com>
Wed, 13 Mar 2013 13:14:00 +0000
(14:14 +0100)
src/core/manager.c
patch
|
blob
|
history
diff --git
a/src/core/manager.c
b/src/core/manager.c
index 77eaa468d95d444db6a9f8a7640458e6e91d74e9..a3eeb4afc10c9837c238bc4e1c9d739e6b9cda25 100644
(file)
--- a/
src/core/manager.c
+++ b/
src/core/manager.c
@@
-230,32
+230,26
@@
static void draw_cylon(char buffer[], size_t buflen, unsigned width, unsigned po
memset(p, ' ', pos-2);
p += pos-2;
}
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) {
*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++ = '*';
}
*p++ = '*';
}
- memcpy(p, ANSI_HIGHLIGHT_OFF, strlen(ANSI_HIGHLIGHT_OFF));
- p += strlen(ANSI_HIGHLIGHT_OFF);
+ p = stpcpy(p, ANSI_HIGHLIGHT_OFF);
if (pos < width) {
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;
}
*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) {
}
static void manager_print_jobs_in_progress(Manager *m) {