added dump suffix

FossilOrigin-Name: 894e6305f65760e1e93fc575b96a45a487bdd253ef0f67f0ad2645f262d204ca
This commit is contained in:
tobias.herre@wikimedia.de
2018-03-07 12:13:58 +00:00
parent accc0929cd
commit 06e50e8318
6 changed files with 42 additions and 10 deletions

View File

@ -14,6 +14,7 @@ static struct cw_FormatDumpSettings CW_FORMAT_DUMP_SETTINGS = {
0, /* inv_len */
'*', /* inv_char */
"\n\t", /* dump_prefix */
"" /* dump_suffix */
" ", /* ascii_prefix */
"\n\t" /* newline */
};
@ -53,7 +54,6 @@ static int cw_format_dump_row(char *dst, const uint8_t * data, int len,
}
}
pdst+=sprintf(pdst,"%s",settings->newline);
return pdst-dst;
}
@ -106,6 +106,10 @@ char *cw_format_dump(const uint8_t * data, int len,
rlen = len-pos;
}
pdst += cw_format_dump_row(pdst,data+pos, rlen, settings);
if(row<rows)
pdst += sprintf(pdst,"%s",settings->newline);
else
pdst += sprintf(pdst,"%s",settings->dump_suffix);
}
return dst;