mode if mode_init for MODE_MAX if strstr mode_init mode_names NULL mod

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mode = 0;
if(mode_init){
for (i = 0; i < MODE_MAX; i++) {
if (strstr (mode_init, mode_names[i]) != NULL) {
mode = i;
}
}
}
fprintf (stderr, " * Mode Init = %s | Mode Load: %d - [%s] \n", mode_init, mode, mode_names[mode]);