# HG changeset patch # User Matti Hamalainen # Date 1559505835 -10800 # Node ID 735b55414a1e4282a6e0dff6487c5d25cc5c72c3 # Parent 26f21e487fe209bf02350ff21e4e4bf734a22315 Fix format reporting. diff -r 26f21e487fe2 -r 735b55414a1e tools/lib64gfx.c --- a/tools/lib64gfx.c Sun Jun 02 21:26:48 2019 +0300 +++ b/tools/lib64gfx.c Sun Jun 02 23:03:55 2019 +0300 @@ -36,16 +36,19 @@ char * dmC64GetImageTypeString(char *buf, const size_t len, const int type, const BOOL lng) { - static const char *fmtModesShort[] = { "ERROR", "HiR", "MC", "ECM" }; - static const char *fmtModesLong[] = { "ERROR", "HiRes", "MultiColor", "Extended Color Mode" }; + static const char *fmtModesShort[] = { "*", "HiR", "MC", "ECM" }; + static const char *fmtModesLong[] = { "*", "HiRes", "MultiColor", "Extended Color Mode" }; + const char *fmtStr; size_t nfmt = type & D64_FMT_MASK; - if (nfmt >= sizeof(fmtModesShort) / sizeof(fmtModesShort[0])) - nfmt = 0; + if (nfmt < sizeof(fmtModesShort) / sizeof(fmtModesShort[0])) + fmtStr = lng ? fmtModesLong[nfmt] : fmtModesShort[nfmt]; + else + fmtStr = lng ? "ERROR" : "ERR"; snprintf(buf, len, "%s %s%s%s", - lng ? fmtModesLong[nfmt] : fmtModesShort[nfmt], + fmtStr, (type & D64_FMT_ILACE) ? (lng ? "Interlaced " : "ILace ") : "", (type & D64_FMT_FLI) ? "FLI " : "", (type & D64_FMT_CHAR) ? "CHAR" : ""