summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2013-03-05 15:52:44 +0100
committerMichal Schmidt <mschmidt@redhat.com>2013-03-13 14:14:13 +0100
commit6282c859bdc6463cb25734dcfd3cf8628d951088 (patch)
tree20cff7f2503ecfa017b6c2b3607a74d889223443 /src/core/manager.c
parent5052495bbaf318d132024e75295da2f5d721420c (diff)
util, manager: and mempset() and use it
Just like mempcpy() is almost identical to memcpy() except the useful return value, so is the relation of mempset() to memset().
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index a3eeb4afc1..8e66732cd7 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -226,10 +226,8 @@ static void draw_cylon(char buffer[], size_t buflen, unsigned width, unsigned po
assert(pos <= width+1); /* 0 or width+1 mean that the center light is behind the corner */
if (pos > 1) {
- if (pos > 2) {
- memset(p, ' ', pos-2);
- p += pos-2;
- }
+ if (pos > 2)
+ p = mempset(p, ' ', pos-2);
p = stpcpy(p, ANSI_RED_ON);
*p++ = '*';
}
@@ -244,10 +242,8 @@ static void draw_cylon(char buffer[], size_t buflen, unsigned width, unsigned po
if (pos < width) {
p = stpcpy(p, ANSI_RED_ON);
*p++ = '*';
- if (pos < width-1) {
- memset(p, ' ', width-1-pos);
- p += width-1-pos;
- }
+ if (pos < width-1)
+ p = mempset(p, ' ', width-1-pos);
p = stpcpy(p, ANSI_HIGHLIGHT_OFF);
}
}