summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/basic/string-util.h2
-rw-r--r--src/journal-remote/journal-gatewayd.c13
2 files changed, 6 insertions, 9 deletions
diff --git a/src/basic/string-util.h b/src/basic/string-util.h
index 055ab66668..ff5efbcf55 100644
--- a/src/basic/string-util.h
+++ b/src/basic/string-util.h
@@ -133,7 +133,7 @@ static inline char *truncate_nl(char *s) {
return truncate_nl_full(s, NULL);
}
-static inline char *skip_leading_chars(const char *s, const char *bad) {
+static inline char* skip_leading_chars(const char *s, const char *bad) {
if (!s)
return NULL;
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;
}