# HG changeset patch # User Matti Hamalainen # Date 1508963448 -10800 # Node ID 0288c4d138f76406688b6bb054a2578dac6a6dea # Parent 422d95735359ef1239171c625e32baf8666c794d Make the hash field also formattable. diff -r 422d95735359 -r 0288c4d138f7 sidinfo.c --- 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;