diff --git a/util/ldb_cmd.h b/util/ldb_cmd.h index 12b5c4a52..bb47b919d 100644 --- a/util/ldb_cmd.h +++ b/util/ldb_cmd.h @@ -99,7 +99,7 @@ public: static string HexToString(const string& str) { string parsed; - if (str[0] == '0' && str[1] == 'x') { + if (str[0] != '0' || str[1] != 'x') { fprintf(stderr, "Invalid hex input %s. Must start with 0x\n", str.c_str()); throw "Invalid hex input";