From 6c7e94087fead341de6adc85cb9a7f412fc6905d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 4 Jul 2017 10:28:46 +0100 Subject: compare the first character of string to be null or not Fixes error: ISO C++ forbids comparison between pointer and integer [-fpermissive] | if (value[0] == '\0') | ^~~~ Signed-off-by: Khem Raj Patch taken from: https://github.com/openembedded/meta-openembedded/commit/c9f063c218181e4eac3a0a67d74ce91b898a6443 --- js/src/shell/jsoptparse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/shell/jsoptparse.cpp b/js/src/shell/jsoptparse.cpp index 204efa1..d3058e1 100644 --- a/js/src/shell/jsoptparse.cpp +++ b/js/src/shell/jsoptparse.cpp @@ -253,7 +253,7 @@ OptionParser::extractValue(size_t argc, char **argv, size_t *i, char **value) char *eq = strchr(argv[*i], '='); if (eq) { *value = eq + 1; - if (value[0] == '\0') + if (value[0][0] == '\0') return error("A value is required for option %.*s", eq - argv[*i], argv[*i]); return Okay; } -- cgit v1.2.1