Mercurial > hg > sidinfo
changeset 150:0288c4d138f7
Make the hash field also formattable.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 25 Oct 2017 23:30:48 +0300 |
parents | 422d95735359 |
children | 6b4fedd81307 |
files | sidinfo.c |
diffstat | 1 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/sidinfo.c Wed Oct 25 23:20:58 2017 +0300 +++ b/sidinfo.c Wed Oct 25 23:30:48 2017 +0300 @@ -82,7 +82,7 @@ { "Name" , NULL , OTYPE_STR }, { "Author" , NULL , OTYPE_STR }, { "Copyright" , NULL , OTYPE_STR }, - { "Hash" , NULL , OTYPE_OTHER }, + { "Hash" , NULL , OTYPE_STR }, { "Songlengths" , "Song lengths" , OTYPE_OTHER }, }; @@ -738,7 +738,7 @@ static void siPrintPSIDInformationField(FILE *outFile, const char *filename, const PSIDHeader *psid, BOOL *shown, const PSFStackItem *item) { const PSFOption *opt = &optPSOptions[item->cmd]; - char tmp[64]; + char tmp[128]; switch (item->cmd) { @@ -807,9 +807,11 @@ case 21: { - siPrintFieldPrefix(outFile, opt); - th_md5_print(outFile, psid->hash); - siPrintFieldSeparator(outFile); + size_t i, k; + for (i = k = 0; i < TH_MD5HASH_LENGTH && k < sizeof(tmp) - 1; i++, k += 2) + sprintf(&tmp[k], "%02x", psid->hash[i]); + + PR(tmp, -1); } break;