From c064a6611539dd53c98c65a9d78d5b2b6dec58dd Mon Sep 17 00:00:00 2001 From: PartialVolume Date: Sat, 30 Nov 2019 17:07:14 +0000 Subject: [PATCH] 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. --- src/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/options.c b/src/options.c index 18d08dc..218a04f 100644 --- a/src/options.c +++ b/src/options.c @@ -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++; }