From b3bd918f29485681ece900e3f38b90f1ac9b1313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Can=20Geli=C5=9F?= Date: Sat, 21 Oct 2017 22:58:24 +0300 Subject: [PATCH] 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. --- xs/src/boost/nowide/cenv.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xs/src/boost/nowide/cenv.hpp b/xs/src/boost/nowide/cenv.hpp index 5f6d084af..5b41b8e8d 100755 --- a/xs/src/boost/nowide/cenv.hpp +++ b/xs/src/boost/nowide/cenv.hpp @@ -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;