From 555c3acd88e3e45e8eec089cfbd43098571d3a36 Mon Sep 17 00:00:00 2001 From: roker Date: Mon, 14 Jun 2021 15:25:54 +0200 Subject: [PATCH] fix member functions --- src/types.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/types.cc b/src/types.cc index c1d1c6f..c52f1ff 100644 --- a/src/types.cc +++ b/src/types.cc @@ -96,7 +96,7 @@ namespace pEp template<> bool StringPairList::empty() const { - return value && value->value; + return !(value && value->value); } template<> @@ -118,14 +118,19 @@ namespace pEp template<> void StringPairList::push_back(::stringpair_t*&& sp) { - stringpair_list_add(value, sp); + auto last = stringpair_list_add(value, sp); + if(value==nullptr) + value = last; + sp = nullptr; } template<> void StringPairList::push_back(StringPair&& sp) { - stringpair_list_add(value, sp.move_out()); + auto last = stringpair_list_add(value, sp.move_out()); + if(value==nullptr) + value = last; } template<>