From d8763abecd5ed12913f3a9126763f8c0d23df247 Mon Sep 17 00:00:00 2001 From: Mark Callaghan Date: Wed, 3 Oct 2012 07:02:07 -0700 Subject: [PATCH] Fix the bounds check for the --readwritepercent option Summary: see above Task ID: # Blame Rev: Test Plan: run db_bench with invalid value for option Revert Plan: Database Impact: Memcache Impact: Other Notes: EImportant: - begin *PUBLIC* platform impact section - Bugzilla: # - end platform impact - Reviewers: dhruba Reviewed By: dhruba CC: heyongqiang Differential Revision: https://reviews.facebook.net/D5823 --- db/db_bench.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db_bench.cc b/db/db_bench.cc index 5e3426b7f..886b38a80 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -1205,7 +1205,7 @@ int main(int argc, char** argv) { (n == 0 || n == 1)) { FLAGS_sync = n; } else if (sscanf(argv[i], "--readwritepercent=%d%c", &n, &junk) == 1 && - (n > 0 || n < 100)) { + n > 0 && n < 100) { FLAGS_readwritepercent = n; } else if (sscanf(argv[i], "--disable_data_sync=%d%c", &n, &junk) == 1 && (n == 0 || n == 1)) {