diff options
author | Martin Willi <martin@revosec.ch> | 2012-07-13 11:46:39 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-07-13 13:23:29 +0200 |
commit | 4addc415a5aaa1bac32a0d10587e1eba5dbcc9b7 (patch) | |
tree | cca4b48d9d0ae8cfa4b1460a805fb3eefc171e1c /src/libstrongswan/printf_hook.c | |
parent | 1b40b74de032b36c199c4c65016e4736c09b6c81 (diff) | |
download | strongswan-4addc415a5aaa1bac32a0d10587e1eba5dbcc9b7.tar.bz2 strongswan-4addc415a5aaa1bac32a0d10587e1eba5dbcc9b7.tar.xz |
Write directly to FILE stream in glibc printf hooks
Diffstat (limited to 'src/libstrongswan/printf_hook.c')
-rw-r--r-- | src/libstrongswan/printf_hook.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/libstrongswan/printf_hook.c b/src/libstrongswan/printf_hook.c index 1ffe550c7..22f5d78d9 100644 --- a/src/libstrongswan/printf_hook.c +++ b/src/libstrongswan/printf_hook.c @@ -86,25 +86,17 @@ static printf_hook_handler_t *printf_hooks[NUM_HANDLERS]; static int custom_print(FILE *stream, const struct printf_info *info, const void *const *args) { - int written; - char buf[PRINTF_BUF_LEN]; printf_hook_spec_t spec; printf_hook_handler_t *handler = printf_hooks[SPEC_TO_INDEX(info->spec)]; printf_hook_data_t data = { - .buf = buf, - .buflen = sizeof(buf), + .stream = stream, }; spec.hash = info->alt; spec.minus = info->left; spec.width = info->width; - written = handler->hook(&data, &spec, args); - if (written > 0) - { - ignore_result(fwrite(buf, 1, written, stream)); - } - return written; + return handler->hook(&data, &spec, args); } /** |