These are all already proven to be true by
surrounding code.
Identified by cppcheck.
Change-Id: Iacf06c113e8db5b7c78270f361ee76938ef1db47
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1613
Message-Id: <
20260419135116.22170-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36666.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
}
else
{
- if (p[1])
- {
- man_state(man, p[1]);
- }
+ man_state(man, p[1]);
if (p[2])
{
man_state(man, p[2]);
{
buffer_list_advance(man->connection.out, sent);
}
- else if (sent < 0)
+ else
{
if (man_io_error(man, "send"))
{
{
msg(M_INFO, "PUSH: No NCP or OCC cipher data received from peer.");
- if (o->enable_ncp_fallback && !tls_multi->remote_ciphername)
+ if (o->enable_ncp_fallback)
{
msg(M_INFO,
"Using data channel cipher '%s' since "
struct dns_server *server =
dns_server_get(&options->dns_options.servers, priority, &options->dns_options.gc);
- if (streq(p[3], "address") && p[4])
+ if (streq(p[3], "address"))
{
for (int i = 4; p[i]; ++i)
{
close(fd);
return retfname;
}
- else if (fd == -1 && errno != EEXIST)
+ else if (errno != EEXIST)
{
/* Something else went wrong, no need to retry. */
msg(M_WARN | M_ERRNO, "Could not create temporary file '%s'", retfname);
{
/* Must have at least three lines. further lines are ignored for
* forward compatibility */
- if (!lines->head || !lines->head->next || !lines->head->next->next)
+ if (!lines->head->next || !lines->head->next->next)
{
msg(M_WARN, "auth pending control file is not at least "
"three lines long.");
sud->directory = data;
len = wcslen(sud->directory) + 1;
size -= len;
- if (size <= 0)
+ if (size == 0)
{
MsgToEventLog(M_ERR, L"Startup data ends at working directory");
ReturnError(pipe, ERROR_STARTUP_DATA, L"GetStartupData", 1, &exit_event);
sud->options = sud->directory + len;
len = wcslen(sud->options) + 1;
size -= len;
- if (size <= 0)
+ if (size == 0)
{
MsgToEventLog(M_ERR, L"Startup data ends at command line options");
ReturnError(pipe, ERROR_STARTUP_DATA, L"GetStartupData", 1, &exit_event);