2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-26 21:48:11 +03:00

invert condition

This commit is contained in:
asmodai 2017-03-23 00:47:27 +03:00
parent 0f4b380bee
commit 6ee60a1f76

@ -321,28 +321,30 @@ const char *CCommandLine::CheckParm(const char *psz, char **ppszValue) const
return nullptr; return nullptr;
char *pret = strstr(m_pszCmdLine, psz); char *pret = strstr(m_pszCmdLine, psz);
if (pret && ppszValue) { if (!pret || !ppszValue)
*ppszValue = nullptr; return pret;
// find the next whitespace *ppszValue = nullptr;
char *p1 = pret;
do {
++p1;
} while (*p1 != ' ' && *p1);
int i = 0; // find the next whitespace
char *p2 = p1 + 1; char *p1 = pret;
do {
++p1;
} while (*p1 != ' ' && *p1);
do { int i = 0;
if (p2[i] == '\0' || p2[i] == ' ') char *p2 = p1 + 1;
break;
sz[i++] = p2[i]; do {
} while (i < sizeof(sz)); if (p2[i] == '\0' || p2[i] == ' ')
break;
sz[i] = '\0'; sz[i++] = p2[i];
*ppszValue = sz; } while (i < sizeof(sz));
}
sz[i] = '\0';
*ppszValue = sz;
return pret; return pret;
} }