summaryrefslogtreecommitdiff
path: root/src/journal/sd-journal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal/sd-journal.c')
-rw-r--r--src/journal/sd-journal.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 6349aeb785..01c91e4c02 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -997,7 +997,7 @@ _public_ int sd_journal_get_cursor(sd_journal *j, char **cursor) {
}
_public_ int sd_journal_seek_cursor(sd_journal *j, const char *cursor) {
- char *w, *state;
+ const char *word, *state;
size_t l;
unsigned long long seqnum, monotonic, realtime, xor_hash;
bool
@@ -1013,18 +1013,18 @@ _public_ int sd_journal_seek_cursor(sd_journal *j, const char *cursor) {
assert_return(!journal_pid_changed(j), -ECHILD);
assert_return(!isempty(cursor), -EINVAL);
- FOREACH_WORD_SEPARATOR(w, l, cursor, ";", state) {
+ FOREACH_WORD_SEPARATOR(word, l, cursor, ";", state) {
char *item;
int k = 0;
- if (l < 2 || w[1] != '=')
+ if (l < 2 || word[1] != '=')
return -EINVAL;
- item = strndup(w, l);
+ item = strndup(word, l);
if (!item)
return -ENOMEM;
- switch (w[0]) {
+ switch (word[0]) {
case 's':
seqnum_id_set = true;
@@ -1103,7 +1103,7 @@ _public_ int sd_journal_seek_cursor(sd_journal *j, const char *cursor) {
_public_ int sd_journal_test_cursor(sd_journal *j, const char *cursor) {
int r;
- char *w, *state;
+ const char *word, *state;
size_t l;
Object *o;
@@ -1118,20 +1118,20 @@ _public_ int sd_journal_test_cursor(sd_journal *j, const char *cursor) {
if (r < 0)
return r;
- FOREACH_WORD_SEPARATOR(w, l, cursor, ";", state) {
+ FOREACH_WORD_SEPARATOR(word, l, cursor, ";", state) {
_cleanup_free_ char *item = NULL;
sd_id128_t id;
unsigned long long ll;
int k = 0;
- if (l < 2 || w[1] != '=')
+ if (l < 2 || word[1] != '=')
return -EINVAL;
- item = strndup(w, l);
+ item = strndup(word, l);
if (!item)
return -ENOMEM;
- switch (w[0]) {
+ switch (word[0]) {
case 's':
k = sd_id128_from_string(item+2, &id);