From 536f5b466bfe5b88cafaa1b04f3052a155376afb Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Thu, 14 May 2020 15:28:39 +0200 Subject: sharkd_session.c: fix a warning reported by gcc 10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit warning: ā€˜%sā€™ directive argument is null [-Wformat-overflow=] 544 | fprintf(stderr, "load: filename=%s\n", tok_file); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I583a94308ad53b461606053def17e8537eec8d65 Reviewed-on: https://code.wireshark.org/review/37195 Petri-Dish: Pascal Quantin Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte --- sharkd_session.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sharkd_session.c') diff --git a/sharkd_session.c b/sharkd_session.c index ffb7bcdc45..0a81b69c2e 100644 --- a/sharkd_session.c +++ b/sharkd_session.c @@ -541,11 +541,11 @@ sharkd_session_process_load(const char *buf, const jsmntok_t *tokens, int count) const char *tok_file = json_find_attr(buf, tokens, count, "file"); int err = 0; - fprintf(stderr, "load: filename=%s\n", tok_file); - if (!tok_file) return; + fprintf(stderr, "load: filename=%s\n", tok_file); + if (sharkd_cf_open(tok_file, WTAP_TYPE_AUTO, FALSE, &err) != CF_OK) { sharkd_json_simple_reply(err, NULL); -- cgit v1.2.3