summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_time_parse.c
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2024-12-19 10:23:57 -0800
committerKonstantin Pavlov <thresh@nginx.com>2024-12-19 10:23:57 -0800
commitd8acad350a52a20918c46c09cb0a0f5479400923 (patch)
tree7d9c4b64daa60d3ac121743dfa3735c6fc5687a4 /src/nxt_time_parse.c
parent624debcf17ea7faab01fa841bd4dcd9f308cf306 (diff)
parent27bde184dedcbf687db2f314c60c037623318a8d (diff)
downloadunit-d8acad350a52a20918c46c09cb0a0f5479400923.tar.gz
unit-d8acad350a52a20918c46c09cb0a0f5479400923.tar.bz2
Merge tag '1.34.0' into packaging1.34.0-1
Unit 1.34.0 release.
Diffstat (limited to 'src/nxt_time_parse.c')
-rw-r--r--src/nxt_time_parse.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/nxt_time_parse.c b/src/nxt_time_parse.c
index 63620b09..1ac52fe4 100644
--- a/src/nxt_time_parse.c
+++ b/src/nxt_time_parse.c
@@ -317,7 +317,6 @@ nxt_term_parse(const u_char *p, size_t len, nxt_bool_t seconds)
enum {
st_first_digit = 0,
st_digit,
- st_letter,
st_space,
} state;
@@ -354,22 +353,17 @@ nxt_term_parse(const u_char *p, size_t len, nxt_bool_t seconds)
state = st_first_digit;
}
- if (state != st_letter) {
+ /* Values below '0' become >= 208. */
+ c = ch - '0';
- /* Values below '0' become >= 208. */
- c = ch - '0';
-
- if (c <= 9) {
- val = val * 10 + c;
- state = st_digit;
- continue;
- }
-
- if (state == st_first_digit) {
- return -1;
- }
+ if (c <= 9) {
+ val = val * 10 + c;
+ state = st_digit;
+ continue;
+ }
- state = st_letter;
+ if (state == st_first_digit) {
+ return -1;
}
switch (ch) {