# HG changeset patch # User Matti Hamalainen # Date 1582069956 -7200 # Node ID ca548150de6ba7316e2a8e2df9362c8b052845a4 # Parent 190f5caaf1a89383304a88aa7d31626f78aa48e7 Fix grepping of consecutive values in fanalyze when using > byte size types. diff -r 190f5caaf1a8 -r ca548150de6b tools/fanalyze.c --- a/tools/fanalyze.c Tue Feb 18 23:31:10 2020 +0200 +++ b/tools/fanalyze.c Wed Feb 19 01:52:36 2020 +0200 @@ -242,10 +242,11 @@ void dmPrintGrepValueList(const DMGrepValue *node, const BOOL match, DMSourceFile *file, const size_t offs) { char mfmt[16]; + unsigned int bsize = dmGrepTypes[node->type].bsize; snprintf(mfmt, sizeof(mfmt), "%%%s%d%s%%s", dmGrepDisp[node->disp].fmtPrefix, - dmGrepTypes[node->type].bsize * 2, + bsize * 2, dmGrepDisp[node->disp].fmt); for (int n = 0; n < node->nvalues; n++) @@ -255,7 +256,7 @@ if (match) { Uint32 mval; - dmGetData(node->type, file, offs + n, &mval); + dmGetData(node->type, file, offs + n * bsize, &mval); printf(mfmt, mval, veol); } else @@ -725,7 +726,7 @@ if (!node->vwildcards[n]) { Uint32 mval; - dmGetData(node->type, file, offs + n, &mval); + dmGetData(node->type, file, offs + n * def->bsize, &mval); if (mval != node->values[n]) {