From 196d590a99e309764e07c9dc23ea98897eebf53a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 27 Jul 2016 22:21:58 +0200 Subject: (error) va_list 'args' was opened but not closed by va_end() Reported-By: cppcheck Gbp-Dch: Ignore --- apt-pkg/contrib/fileutl.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'apt-pkg/contrib/fileutl.cc') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index fc578cd23..8fd0ac617 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -2682,13 +2682,12 @@ bool FileFd::FileFdErrno(const char *Function, const char *Description,...) va_list args; size_t msgSize = 400; int const errsv = errno; - while (true) - { + bool retry; + do { va_start(args,Description); - if (_error->InsertErrno(GlobalError::ERROR, Function, Description, args, errsv, msgSize) == false) - break; + retry = _error->InsertErrno(GlobalError::ERROR, Function, Description, args, errsv, msgSize); va_end(args); - } + } while (retry); return false; } /*}}}*/ @@ -2697,13 +2696,12 @@ bool FileFd::FileFdError(const char *Description,...) { Flags |= Fail; va_list args; size_t msgSize = 400; - while (true) - { + bool retry; + do { va_start(args,Description); - if (_error->Insert(GlobalError::ERROR, Description, args, msgSize) == false) - break; + retry = _error->Insert(GlobalError::ERROR, Description, args, msgSize); va_end(args); - } + } while (retry); return false; } /*}}}*/ -- cgit v1.2.3-70-g09d2