From f5683f1fecbbc3d8d71424b094f5e45ecd5e92e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?bj=C3=B6rn=20petersen?= Date: Fri, 7 Jun 2019 13:34:00 +0200 Subject: [PATCH] fix: remove unneeded string duplication before passing to the callback --- src/dc_log.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dc_log.rs b/src/dc_log.rs index 9fdc3052a..5b96ddec4 100644 --- a/src/dc_log.rs +++ b/src/dc_log.rs @@ -99,7 +99,7 @@ macro_rules! info { let formatted_c = $crate::dc_tools::to_cstring(formatted); unsafe { ($ctx.cb)($ctx, $crate::constants::Event::INFO, $data1 as uintptr_t, - $crate::dc_tools::dc_strdup(formatted_c.as_ptr()) as uintptr_t) + formatted_c.as_ptr() as uintptr_t) } }}; } @@ -114,7 +114,7 @@ macro_rules! warn { let formatted_c = $crate::dc_tools::to_cstring(formatted); unsafe { ($ctx.cb)($ctx, $crate::constants::Event::WARNING, $data1 as libc::uintptr_t, - $crate::dc_tools::dc_strdup(formatted_c.as_ptr()) as libc::uintptr_t) + formatted_c.as_ptr() as libc::uintptr_t) } }; } @@ -129,7 +129,7 @@ macro_rules! error { let formatted_c = $crate::dc_tools::to_cstring(formatted); unsafe { ($ctx.cb)($ctx, $crate::constants::Event::ERROR, $data1 as uintptr_t, - $crate::dc_tools::dc_strdup(formatted_c.as_ptr()) as uintptr_t) + formatted_c.as_ptr() as uintptr_t) } }; } @@ -144,7 +144,7 @@ macro_rules! log_event { let formatted_c = $crate::dc_tools::to_cstring(formatted); unsafe { ($ctx.cb)($ctx, $event, $data1 as uintptr_t, - $crate::dc_tools::dc_strdup(formatted_c.as_ptr()) as uintptr_t) + formatted_c.as_ptr() as uintptr_t) } }; }