# HG changeset patch # User Matti Hamalainen # Date 1582128049 -7200 # Node ID 758223ba6551fb774907f5d645ab67fd35c5e5c0 # Parent ca548150de6ba7316e2a8e2df9362c8b052845a4 Only print grep value lists if verbosity >= 1. diff -r ca548150de6b -r 758223ba6551 tools/fanalyze.c --- a/tools/fanalyze.c Wed Feb 19 01:52:36 2020 +0200 +++ b/tools/fanalyze.c Wed Feb 19 18:00:49 2020 +0200 @@ -239,7 +239,7 @@ } -void dmPrintGrepValueList(const DMGrepValue *node, const BOOL match, DMSourceFile *file, const size_t offs) +void dmPrintGrepValueList(FILE *fh, const DMGrepValue *node, const BOOL match, DMSourceFile *file, const size_t offs) { char mfmt[16]; unsigned int bsize = dmGrepTypes[node->type].bsize; @@ -251,20 +251,20 @@ for (int n = 0; n < node->nvalues; n++) { - const char *veol = (n + 1 < node->nvalues) ? " " : "\n"; + const char *veol = (n + 1 < node->nvalues) ? " " : ""; if (match) { Uint32 mval; dmGetData(node->type, file, offs + n * bsize, &mval); - printf(mfmt, mval, veol); + fprintf(fh, mfmt, mval, veol); } else { if (node->vwildcards[n]) - printf("?%s", veol); + fprintf(fh, "?%s", veol); else - printf(mfmt, node->values[n], veol); + fprintf(fh, mfmt, node->values[n], veol); } } } @@ -467,7 +467,8 @@ printf("Grep %s: ", dmGrepTypes[val.type].name); - dmPrintGrepValueList(node, FALSE, NULL, 0); + dmPrintGrepValueList(stdout, node, FALSE, NULL, 0); + printf("\n"); } } else @@ -737,8 +738,13 @@ if (match) { - printf("%08" DM_PRIx_SIZE_T " : ", offs); - dmPrintGrepValueList(node, TRUE, file, offs); + printf("%08" DM_PRIx_SIZE_T, offs); + if (dmVerbosity >= 1) + { + printf(" : "); + dmPrintGrepValueList(stdout, node, TRUE, file, offs); + } + printf("\n"); } } }