From: Oliver Kurth Date: Wed, 30 Oct 2019 18:18:23 +0000 (-0700) Subject: Remove dead code in dndCommon.c reported by Coverity. X-Git-Tag: stable-11.1.0~176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da965e20d68d1d2c65a477c07a813a7d0f5402d6;p=thirdparty%2Fopen-vm-tools.git Remove dead code in dndCommon.c reported by Coverity. --- diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndCommon.c b/open-vm-tools/services/plugins/dndcp/dnd/dndCommon.c index ed592f482..44f4cf397 100644 --- a/open-vm-tools/services/plugins/dndcp/dnd/dndCommon.c +++ b/open-vm-tools/services/plugins/dndcp/dnd/dndCommon.c @@ -502,23 +502,18 @@ DnD_LegacyConvertToCPName(const char *nameIn, // IN: Buffer to convert */ for (; *winNameIn != '\0' && bufOut < endOut; winNameIn++) { - if (ignores) { - char *currIgnore = ignores; - Bool ignore = FALSE; - - while (*currIgnore != '\0') { - if (*winNameIn == *currIgnore) { - ignore = TRUE; - break; - } - currIgnore++; - } + char *currIgnore = ignores; + Bool ignore = FALSE; - if (!ignore) { - *bufOut = (*winNameIn == pathSep) ? '\0' : *winNameIn; - bufOut++; + while (*currIgnore != '\0') { + if (*winNameIn == *currIgnore) { + ignore = TRUE; + break; } - } else { + currIgnore++; + } + + if (!ignore) { *bufOut = (*winNameIn == pathSep) ? '\0' : *winNameIn; bufOut++; }