summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-08-03 14:31:28 +0300
committermidipix <writeonce@midipix.org>2015-09-26 11:16:54 -0400
commit188aac80bc344c30d15e82931391c833953fd432 (patch)
tree07d300cbe0abb2e7050ca6b375d39a3f59ae4be0
parentaf6bd749fd1d453f68fb5b22914a8811e916f8dd (diff)
downloadntapi-188aac80bc344c30d15e82931391c833953fd432.tar.bz2
ntapi-188aac80bc344c30d15e82931391c833953fd432.tar.xz
fix incorrect logic (&& vs. &), remove unnecessary comparisons.
-rw-r--r--src/argv/ntapi_tt_argv_envp.c3
-rw-r--r--src/argv/ntapi_tt_get_option.c6
2 files changed, 4 insertions, 5 deletions
diff --git a/src/argv/ntapi_tt_argv_envp.c b/src/argv/ntapi_tt_argv_envp.c
index bfa0cd2..7a08776 100644
--- a/src/argv/ntapi_tt_argv_envp.c
+++ b/src/argv/ntapi_tt_argv_envp.c
@@ -193,8 +193,7 @@ int32_t __stdcall __ntapi_tt_parse_cmd_line_args_utf16(
} else {
/* the current character is not a delimiter... */
/* determine wch_next */
- if (((*wch >= 0x0000) && (*wch < 0xD800)) \
- || ((*wch >= 0xE000) && (*wch < 0x10000))) {
+ if ((*wch < 0xD800) || (*wch >= 0xE000)) {
/* in the BMP, single 16-bit representation */
wch_next = wch + 1;
} else if ((*wch >= 0xD800) && (*wch < 0xDC00)) {
diff --git a/src/argv/ntapi_tt_get_option.c b/src/argv/ntapi_tt_get_option.c
index e6f0748..7056a3c 100644
--- a/src/argv/ntapi_tt_get_option.c
+++ b/src/argv/ntapi_tt_get_option.c
@@ -55,7 +55,7 @@
static int __inline__ __fastcall __is_bmp_code_point(wchar16_t code_point)
{
return (((code_point >= 0x0000) && (code_point < 0xD800)) \
- || ((code_point >= 0xE000) && (code_point < 0x10000)));
+ || (code_point >= 0xE000));
}
@@ -418,7 +418,7 @@ int32_t __stdcall __ntapi_tt_validate_program_options(
/* validate the occurrence */
if (idx_option) {
- if (option->flags && NT_OPTION_ALLOWED_ONCE) {
+ if (option->flags & NT_OPTION_ALLOWED_ONCE) {
if (option->option_count) {
options_meta->idx_invalid_argument
= idx_arg;
@@ -428,7 +428,7 @@ int32_t __stdcall __ntapi_tt_validate_program_options(
}
}
- if (option->flags && NT_OPTION_VALUE_REQUIRED) {
+ if (option->flags & NT_OPTION_VALUE_REQUIRED) {
if ((!(*pvalue)) || (*pvalue == HYPHEN)) {
options_meta->idx_missing_option_value
= idx_arg;