utils: Fix %T printf hook on big-endian systems

The cast to a bool* cut of the actual value on big-endian systems
if bool was shorter than int because the bool argument to printf gets
promoted to an int.

Fixes #479.
This commit is contained in:
Tobias Brunner 2014-01-06 15:30:02 +01:00
parent 0773c7fd71
commit 13f2d3a2f6

View File

@ -570,7 +570,7 @@ int time_printf_hook(printf_hook_data_t *data, printf_hook_spec_t *spec,
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
time_t *time = *((time_t**)(args[0]));
bool utc = *((bool*)(args[1]));;
bool utc = *((int*)(args[1]));
struct tm t;
if (*time == UNDEFINED_TIME)