All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: fstests@vger.kernel.org
Cc: zlang@kernel.org
Subject: [PATCH 1/4] fstests: doio.c, fix missing initialization of -C arg
Date: Sun, 29 Jan 2023 10:42:30 +0800	[thread overview]
Message-ID: <d8627cbdfff4554bcc1442845726ef7119b8ada6.1674870429.git.anand.jain@oracle.com> (raw)
In-Reply-To: <cover.1674870429.git.anand.jain@oracle.com>

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 --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;
-- 
2.38.1


  reply	other threads:[~2023-01-29  2:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-29  2:42 [PATCH 0/4] fstest: fix compilation warnings Anand Jain
2023-01-29  2:42 ` Anand Jain [this message]
2023-01-29  2:42 ` [PATCH 2/4] fstests: fstest.c, fix compile warnings replace sprintf with snprintf Anand Jain
2023-01-29  2:42 ` [PATCH 3/4] fstests: t_getcwd.c, fix a warning related to buffer overflow Anand Jain
2023-01-29  2:42 ` [PATCH 4/4] fstests: aiodio_sparse2.c, fix compiler warning " Anand Jain
2023-01-30 20:11 ` [PATCH 0/4] fstest: fix compilation warnings Bill O'Donnell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d8627cbdfff4554bcc1442845726ef7119b8ada6.1674870429.git.anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=zlang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.