Fix comparison bw integer and pointer (#4155)

* Fix comparison bw integer and pointer

Error: ISO C++ forbids comparison between pointer and integer [-fpermissive]

* Check for nullptr input string.
This commit is contained in:
Can Geliş 2017-10-21 22:58:24 +03:00 committed by Joseph Lenox
parent 2675e697ef
commit b3bd918f29

View File

@ -99,9 +99,11 @@ namespace nowide {
///
inline int putenv(char *string)
{
if (string == nullptr) return -1;
char const *key = string;
char const *key_end = string;
while(*key_end!='=' && key_end!='\0')
while(*key_end!='=' && *key_end!='\0')
key_end++;
if(*key_end == '\0')
return -1;