[vala/staging] scanner: "\x" requires two hex digits at most #2
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] scanner: "\x" requires two hex digits at most #2
- Date: Mon, 25 Nov 2019 19:27:25 +0000 (UTC)
commit 46c0faba9243366f0bcf805286091038e11e0c54
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Nov 25 09:35:53 2019 +0100
scanner: "\x" requires two hex digits at most #2
vala/valageniescanner.vala | 14 +++++++-------
vala/valascanner.vala | 8 ++++----
2 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/vala/valageniescanner.vala b/vala/valageniescanner.vala
index 26d34aff7..4c0928b9b 100644
--- a/vala/valageniescanner.vala
+++ b/vala/valageniescanner.vala
@@ -248,12 +248,12 @@ public class Vala.Genie.Scanner {
current++;
token_length_in_chars++;
int digit_length;
- for (digit_length = 0; digit_length < 2 && current <
end && current[0].isxdigit (); digit_length++) {
+ for (digit_length = 0; current < end &&
current[0].isxdigit (); digit_length++) {
current++;
token_length_in_chars++;
}
- if (digit_length != 2) {
- Report.error (get_source_reference
(token_length_in_chars), "\\x requires two hex digits");
+ if (digit_length < 1 || digit_length > 2) {
+ Report.error (get_source_reference
(token_length_in_chars), "\\x requires at least one or two hex digit");
}
break;
default:
@@ -771,7 +771,7 @@ public class Vala.Genie.Scanner {
current++;
token_length_in_chars++;
int digit_length;
- for (digit_length = 0; digit_length < 2 && current <
end && current[0].isxdigit (); digit_length++) {
+ for (digit_length = 0; current < end &&
current[0].isxdigit (); digit_length++) {
current++;
token_length_in_chars++;
}
@@ -1344,12 +1344,12 @@ public class Vala.Genie.Scanner {
current++;
token_length_in_chars++;
int digit_length;
- for (digit_length = 0; digit_length < 2 && current <
end && current[0].isxdigit (); digit_length++) {
+ for (digit_length = 0; current < end &&
current[0].isxdigit (); digit_length++) {
current++;
token_length_in_chars++;
}
- if (digit_length != 2) {
- Report.error (get_source_reference
(token_length_in_chars), "\\x requires two hex digits");
+ if (digit_length < 1 || digit_length > 2) {
+ Report.error (get_source_reference
(token_length_in_chars), "\\x requires at least one or two hex digit");
}
break;
default:
diff --git a/vala/valascanner.vala b/vala/valascanner.vala
index e824fd618..5aa18f443 100644
--- a/vala/valascanner.vala
+++ b/vala/valascanner.vala
@@ -237,8 +237,8 @@ public class Vala.Scanner {
current++;
token_length_in_chars++;
}
- if (digit_length < 1) {
- Report.error (get_source_reference
(token_length_in_chars), "\\x requires at least one hex digit");
+ if (digit_length < 1 || digit_length > 2) {
+ Report.error (get_source_reference
(token_length_in_chars), "\\x requires at least one or two hex digit");
}
break;
default:
@@ -1184,8 +1184,8 @@ public class Vala.Scanner {
current++;
token_length_in_chars++;
}
- if (digit_length < 1) {
- Report.error (get_source_reference
(token_length_in_chars), "\\x requires at least one hex digit");
+ if (digit_length < 1 || digit_length > 2) {
+ Report.error (get_source_reference
(token_length_in_chars), "\\x requires at least one or two hex digit");
}
break;
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]