mirror of
https://github.com/sharkcz/rkdeveloptool.git
synced 2024-10-20 06:49:33 +02:00
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:
parent
370700b5d3
commit
08c0d21888
2
main.cpp
2
main.cpp
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user