Do not return garbage in run_parts
If scandir(3) returns 0, the uninitialized value of execute_result will be returned.
This commit is contained in:
parent
a8166a86ed
commit
b2bc1f6927
@ -48,7 +48,7 @@ int run_parts (const char *directory, const char *name, const char *action)
|
|||||||
int execute_result;
|
int execute_result;
|
||||||
|
|
||||||
scanlist = scandir (directory, &namelist, 0, alphasort);
|
scanlist = scandir (directory, &namelist, 0, alphasort);
|
||||||
if (scanlist<0) {
|
if (scanlist<=0) {
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user