We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0c382cb + ceee0e7 commit 5ab83d6Copy full SHA for 5ab83d6
unixlauncher.c
@@ -33,8 +33,7 @@ static char *which(const char *const executable) {
33
dirs[dirs_length] = ':';
34
35
size_t dir_head = 0;
36
- size_t i = 0;
37
- do {
+ for (size_t i = 0; i <= dirs_length; i++) {
38
if (dirs[i] == ':') {
39
// Declare convenient path variables
40
char *const dir = dirs + dir_head;
@@ -61,7 +60,7 @@ static char *which(const char *const executable) {
61
60
62
dir_head = i + 1;
63
}
64
- } while (dirs[i++]);
+ };
65
66
// Lookup has failed, free if necessary and return NULL
67
if (exe_path != NULL) {
0 commit comments