]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fstests: doio.c, fix missing initialization of -C arg
authorAnand Jain <anand.jain@oracle.com>
Sun, 29 Jan 2023 02:42:30 +0000 (10:42 +0800)
committerZorro Lang <zlang@kernel.org>
Fri, 3 Feb 2023 18:06:30 +0000 (02:06 +0800)
Resolves GCC warnings on null values for %tok.

doio.c: In function 'parse_cmdline':
doio.c:3113:33: warning: '%s' directive argument is null [-Wformat-overflow=]
3113 | fprintf(stderr,
     | ^~~~~~~~~~~~~~~
3114 | "%s:  Illegal -C arg (%s).  Must be one of: ",
     | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3115 | Prog, tok);
     | ~~~~~~~~~~

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
ltp/doio.c

index 83f8cf556325574a84ae1b0aaa4817f665bd7398..fd64df0f674eba1cbc120ee484a230d7550fbf67 100644 (file)
@@ -3106,6 +3106,7 @@ char      *opts;
 
                case 'C':
                        C_opt++;
+                       tok = strtok(optarg, ",");
                        for(s=checkmap; s->string != NULL; s++)
                                if(!strcmp(s->string, optarg))
                                        break;