diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-11-22 04:27:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 04:27:37 +0100 |
commit | 6ad17c31fb1a49b6e97456b0ab1712effe81deea (patch) | |
tree | 094ab9447e248654f9785a1371b25d9f5135c794 /src | |
parent | systemctl: edit: write override files as text files (diff) | |
parent | basic/strv: check printf arguments to strv_extendf() (diff) | |
download | systemd-6ad17c31fb1a49b6e97456b0ab1712effe81deea.tar.xz systemd-6ad17c31fb1a49b6e97456b0ab1712effe81deea.zip |
Merge pull request #25470 from keszybz/strv-extendf-format
Improve check for strv_extendf() format string
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/strv.h | 2 | ||||
-rw-r--r-- | src/core/timer.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/basic/strv.h b/src/basic/strv.h index 87a7038a54..f82c76589d 100644 --- a/src/basic/strv.h +++ b/src/basic/strv.h @@ -45,7 +45,7 @@ static inline int strv_extend(char ***l, const char *value) { return strv_extend_with_size(l, NULL, value); } -int strv_extendf(char ***l, const char *format, ...) _printf_(2,0); +int strv_extendf(char ***l, const char *format, ...) _printf_(2,3); int strv_extend_front(char ***l, const char *value); int strv_push_with_size(char ***l, size_t *n, char *value); diff --git a/src/core/timer.c b/src/core/timer.c index 8bd430b931..b6810c8599 100644 --- a/src/core/timer.c +++ b/src/core/timer.c @@ -948,11 +948,11 @@ static int activation_details_timer_append_env(ActivationDetails *details, char if (!dual_timestamp_is_set(&t->last_trigger)) return 0; - r = strv_extendf(strv, "TRIGGER_TIMER_REALTIME_USEC=%" USEC_FMT, t->last_trigger.realtime); + r = strv_extendf(strv, "TRIGGER_TIMER_REALTIME_USEC=" USEC_FMT, t->last_trigger.realtime); if (r < 0) return r; - r = strv_extendf(strv, "TRIGGER_TIMER_MONOTONIC_USEC=%" USEC_FMT, t->last_trigger.monotonic); + r = strv_extendf(strv, "TRIGGER_TIMER_MONOTONIC_USEC=" USEC_FMT, t->last_trigger.monotonic); if (r < 0) return r; @@ -974,7 +974,7 @@ static int activation_details_timer_append_pair(ActivationDetails *details, char if (r < 0) return r; - r = strv_extendf(strv, "%" USEC_FMT, t->last_trigger.realtime); + r = strv_extendf(strv, USEC_FMT, t->last_trigger.realtime); if (r < 0) return r; @@ -982,7 +982,7 @@ static int activation_details_timer_append_pair(ActivationDetails *details, char if (r < 0) return r; - r = strv_extendf(strv, "%" USEC_FMT, t->last_trigger.monotonic); + r = strv_extendf(strv, USEC_FMT, t->last_trigger.monotonic); if (r < 0) return r; |