From: Tobias Brunner Date: Mon, 6 Jan 2014 14:30:02 +0000 (+0100) Subject: utils: Fix %T printf hook on big-endian systems X-Git-Tag: 5.1.2dr3~11 X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=commitdiff_plain;h=13f2d3a2f637fc5277fc0752392f56d1af7a1ccb 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. --- diff --git a/src/libstrongswan/utils/utils.c b/src/libstrongswan/utils/utils.c index 266fb43..4bacb58 100644 --- a/src/libstrongswan/utils/utils.c +++ b/src/libstrongswan/utils/utils.c @@ -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)