catools: dbr_long_t is only 32 bits wide

Don't print it as a native long.
Fixes LP: #1699332
This commit is contained in:
Andrew Johnson
2017-06-20 15:49:41 -05:00
parent a1dc16848c
commit 6b5e7da4fd

View File

@@ -81,14 +81,14 @@ static void sprint_long (char *ret, dbr_long_t val, IntFormatT outType)
}
else {
const char *fmt[4] = { /* Order must match the enum IntFormatT */
"%ld" /* dec */,
"0" /* bin, val is 0 */,
"0o%lo" /* oct */,
"0x%lX" /* hex */
"%d" /* dec */,
"0" /* bin and val is 0 */,
"0o%o" /* oct */,
"0x%X" /* hex */
};
/* Formats have long modifier, pass value as a long */
sprintf(ret, fmt[outType], (long) val);
/* dbr_long_t is actually an int on all supported platforms */
sprintf(ret, fmt[outType], (int) val);
}
}