[PATCH applied] Re: Remove various redundant conditionals

Gert Doering <[email protected]>
Newsgroups gmane.network.openvpn.devel
Message-ID <[email protected]>
Verified each of the finding by staring at the code for long enough :-) - the
interactive.c one gave me a bit of headache, trying to understand why it
can never underrun (I'm fully in the "check with 'if (thing <= 0)' to be
guarded against miscalculations" camp).  Well, it cannot, because we have
a size_t here, so cppcheck is very obviously right - but the code itself
also ensures that we have a 0-byte at the end, and thus wcslen() can never
"escape" the boundaries of "size".

Out they go...  test compiled on mingw.  And BB all green, of course.

Your patch has been applied to the master branch.

commit 22062deb5dc04670b48511580d576df3c4682b2e
Author: Frank Lichtenheld
Date:   Sun Apr 19 15:51:11 2026 +0200

     Remove various redundant conditionals

     Signed-off-by: Frank Lichtenheld <[email protected]>
     Acked-by: Gert Doering <[email protected]>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1613
     Message-Id: <[email protected]>
     URL: https://www.mail-archive.com/[email protected]/msg36666.html
     Signed-off-by: Gert Doering <[email protected]>


--
kind regards,

Gert Doering
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.