warning: logical 'or' of collectively exhaustive tests is always true

If using || in the while statement and if 'MAX_DRIVE_PATH_LENGTH' was exceeded the while loop would loop indefinitely.
This commit is contained in:
PartialVolume
2019-11-30 17:07:14 +00:00
committed by GitHub
parent 000ebe6deb
commit c064a66115

View File

@@ -296,7 +296,7 @@ int nwipe_options_parse( int argc, char** argv )
{ /* This section deals with file names that exceed
MAX_DRIVE_PATH_LENGTH */
nwipe_options.exclude[idx_drive][idx_drive_chr] = 0;
while( optarg[idx_optarg] != 0 || optarg[idx_optarg] != ',' )
while( optarg[idx_optarg] != 0 && optarg[idx_optarg] != ',' )
{
idx_optarg++;
}