From a27b5f6a8815bbb4153d59845cb7a94a21b29c72 Mon Sep 17 00:00:00 2001 From: "Peter W. Draper" <p.w.draper@durham.ac.uk> Date: Fri, 15 May 2020 09:30:45 +0100 Subject: [PATCH] Fix Wextra warning --- mpiuse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mpiuse.c b/mpiuse.c index 6bd7b31..1a2b46b 100644 --- a/mpiuse.c +++ b/mpiuse.c @@ -155,7 +155,7 @@ void mpiuse_log_restore(const char *filename) { while (!feof(fd)) { if (fgets(line, 132, fd) != NULL) { - if (line[0] != '#') { + if (line[0] != '#' && line[0] != '\n') { sscanf(line, "%zd %zd %zd %d %d %d %s %d %s %d %d %d %zd %zd", &stic, &etic, &dtic, &step, &rank, &otherrank, type, &itype, subtype, &isubtype, &activation, &tag, &size, &sum); @@ -254,6 +254,6 @@ int mpiuse_nr_ranks(void) { return mpiuse_max_rank + 1; } */ struct mpiuse_log_entry *mpiuse_get_log(int ind) { - if (ind < mpiuse_log_count && ind >= 0) return &mpiuse_log[ind]; + if (ind < (int)mpiuse_log_count && ind >= 0) return &mpiuse_log[ind]; return NULL; } -- GitLab