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
659251c5
Commit
659251c5
authored
Apr 24, 2014
by
Hisham Muhammad
Browse files
Fix array limit.
parent
e0209da8
Changes
1
Hide whitespace changes
Inline
Side-by-side
BatteryMeter.c
View file @
659251c5
...
...
@@ -56,13 +56,14 @@ static unsigned long int parseBatInfo(const char *fileName, const unsigned short
if
(
!
batteryDir
)
return
0
;
char
*
batteries
[
64
];
#define MAX_BATTERIES 64
char
*
batteries
[
MAX_BATTERIES
];
unsigned
int
nBatteries
=
0
;
memset
(
batteries
,
sizeof
batteries
,
sizeof
(
char
*
));
memset
(
batteries
,
MAX_BATTERIES
,
sizeof
(
char
*
));
struct
dirent
result
;
struct
dirent
*
dirEntry
;
while
(
nBatteries
<
sizeof
batteries
)
{
while
(
nBatteries
<
MAX_BATTERIES
)
{
readdir_r
(
batteryDir
,
&
result
,
&
dirEntry
);
if
(
!
dirEntry
)
break
;
...
...
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