From 13f2d3a2f637fc5277fc0752392f56d1af7a1ccb Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 6 Jan 2014 15:30:02 +0100 Subject: 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. --- src/libstrongswan/utils/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstrongswan/utils/utils.c') diff --git a/src/libstrongswan/utils/utils.c b/src/libstrongswan/utils/utils.c index 266fb4357..4bacb5834 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) -- cgit v1.2.3