Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
6c2f698a
Commit
6c2f698a
authored
Mar 25, 2016
by
Hisham Muhammad
Browse files
Merge pull request #458 from Explorer09/bar-tweaks
BarMeterMode_draw() minor code improvement
parents
3a4c0fa2
7b3c8bc7
Changes
1
Show whitespace changes
Inline
Side-by-side
Meter.c
View file @
6c2f698a
...
@@ -287,11 +287,8 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
...
@@ -287,11 +287,8 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
char
bar
[
w
+
1
];
char
bar
[
w
+
1
];
int
blockSizes
[
10
];
int
blockSizes
[
10
];
for
(
int
i
=
0
;
i
<
w
;
i
++
)
bar
[
i
]
=
' '
;
const
size_t
barOffset
=
w
-
MIN
((
int
)
strlen
(
buffer
),
w
);
snprintf
(
bar
,
w
+
1
,
"%*s"
,
w
,
buffer
);
snprintf
(
bar
+
barOffset
,
w
-
barOffset
+
1
,
"%s"
,
buffer
);
// First draw in the bar[] buffer...
// First draw in the bar[] buffer...
int
offset
=
0
;
int
offset
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment