From ce75691eaed0c71c5eb8d258c534dd97d96297a5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 17 Jun 2023 00:35:05 -0400 Subject: [PATCH] address issues flagged by coverity scan --- src/DPD-REACT/fix_eos_table_rx.cpp | 10 ++++------ src/DPD-REACT/fix_rx.cpp | 15 +++++---------- src/YAFF/pair_lj_switch3_coulgauss_long.cpp | 2 -- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/DPD-REACT/fix_eos_table_rx.cpp b/src/DPD-REACT/fix_eos_table_rx.cpp index 2687a11658..f7afddc64f 100644 --- a/src/DPD-REACT/fix_eos_table_rx.cpp +++ b/src/DPD-REACT/fix_eos_table_rx.cpp @@ -476,16 +476,14 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword) utils::sfgets(FLERR,line,MAXLINE,fp,file,error); nwords = utils::count_words(utils::trim_comment(line)); - if (nwords != nspecies+2) { - printf("nwords=%d nspecies=%d\n",nwords,nspecies); - error->all(FLERR,"Illegal fix eos/table/rx command"); - } - nwords = 0; + if (nwords != nspecies+2) + error->all(FLERR,"Illegal fix eos/table/rx command: nwords={} nspecies={}", nwords, nspecies); + word = strtok(line," \t\n\r\f"); word = strtok(nullptr," \t\n\r\f"); rtmp = atof(word); - for (int icolumn=0;icolumn