use strncmp to compare string literal

Fixes build error with Apple LLVM version 8.1.0 (clang-802.0.42)

main.cpp:1160:18: error: result of comparison against a string literal
is unspecified (use strncmp instead) [-Werror,-Wstring-compare]
                if (configPath == (char*)DEF_CONFIG_FILE) {
		                                 ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
This commit is contained in:
Klaus Goger 2017-09-18 21:17:14 +02:00
parent 370700b5d3
commit 08c0d21888

View File

@ -1157,7 +1157,7 @@ static bool parseOpts(void) {
file = fopen(configPath, "r");
if (!file) {
fprintf(stderr, "config (%s) not found!\n", configPath);
if (configPath == (char*)DEF_CONFIG_FILE) {
if (strcmp(configPath, (char*)DEF_CONFIG_FILE) == 0) {
file = fopen(DEF_CONFIG_FILE, "w");
if (file) {
fprintf(stderr, "creating defconfig\n");