From 54e28263aff42350e2970073a8783865fe9b6f9e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 22 Oct 2011 20:44:05 -0700 Subject: [PATCH] scratchtool[pp]: fix rados_conf_set/get test of log_to_stderr Fix this warning warning: scratchtool.c:142: comparison with string literal results in unspecified behavior and flips the logic. Signed-off-by: Sage Weil --- src/scratchtool.c | 2 +- src/scratchtoolpp.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scratchtool.c b/src/scratchtool.c index 6022d1e1b015a..e9b5245989082 100644 --- a/src/scratchtool.c +++ b/src/scratchtool.c @@ -139,7 +139,7 @@ static int testrados(void) printf("error: failed to read log_to_stderr from config\n"); return 1; } - if (tmp == "true") { + if (strcmp(tmp, "true")) { printf("error: new setting for log_to_stderr failed to take effect.\n"); return 1; } diff --git a/src/scratchtoolpp.cc b/src/scratchtoolpp.cc index 98bfd2a1c21a2..01db29e9f2b52 100644 --- a/src/scratchtoolpp.cc +++ b/src/scratchtoolpp.cc @@ -73,7 +73,7 @@ int main(int argc, const char **argv) printf("error: failed to read log_to_stderr from config\n"); exit(1); } - if (tmp == "true") { + if (tmp != "true") { printf("error: new setting for log_to_stderr failed to take effect.\n"); exit(1); } -- 2.39.5