summaryrefslogtreecommitdiffstats
path: root/src/journal-remote/journal-gatewayd.c
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-04-17 15:50:22 +0200
committerMike Yuan <me@yhndnzj.com>2024-04-17 15:50:22 +0200
commitee0373cb8076d365e4370a4d10f56c4fc1756854 (patch)
tree615ba699686de85701a34b17ca464136c6f8cd16 /src/journal-remote/journal-gatewayd.c
parentjournal-gatewayd: add missing assertions (diff)
downloadsystemd-ee0373cb8076d365e4370a4d10f56c4fc1756854.tar.xz
systemd-ee0373cb8076d365e4370a4d10f56c4fc1756854.zip
journal-gatewayd: use skip_leading_chars where appropriate
Prompted by c5d675472588815dedf67af8c36da0fac398fb3e
Diffstat (limited to '')
-rw-r--r--src/journal-remote/journal-gatewayd.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c
index 036283fcd2..dd91f22923 100644
--- a/src/journal-remote/journal-gatewayd.c
+++ b/src/journal-remote/journal-gatewayd.c
@@ -446,17 +446,14 @@ static int request_parse_range(
return -EINVAL;
m->n_skip = 0;
+
range_after_eq = startswith(range, "entries=");
- if (range_after_eq) {
- range_after_eq += strspn(range_after_eq, WHITESPACE);
- return request_parse_range_entries(m, range_after_eq);
- }
+ if (range_after_eq)
+ return request_parse_range_entries(m, skip_leading_chars(range_after_eq, /* bad = */ NULL));
range_after_eq = startswith(range, "realtime=");
- if (range_after_eq) {
- range_after_eq += strspn(range_after_eq, WHITESPACE);
- return request_parse_range_time(m, range_after_eq);
- }
+ if (range_after_eq)
+ return request_parse_range_time(m, skip_leading_chars(range_after_eq, /* bad = */ NULL));
return 0;
}