diff mbox series

[1/4] fstests: doio.c, fix missing initialization of -C arg

Message ID d8627cbdfff4554bcc1442845726ef7119b8ada6.1674870429.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series fstest: fix compilation warnings | expand

Commit Message

Anand Jain Jan. 29, 2023, 2:42 a.m. UTC
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>
---
 ltp/doio.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/ltp/doio.c b/ltp/doio.c
index 83f8cf556325..fd64df0f674e 100644
--- a/ltp/doio.c
+++ b/ltp/doio.c
@@ -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;