summaryrefslogtreecommitdiffstats
path: root/src/veritysetup/veritysetup-generator.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-10-16 18:01:00 +0200
committerLennart Poettering <lennart@poettering.net>2023-10-17 14:36:54 +0200
commit0ff6ff2b29dfb02a803515fb0160d9963d2389d5 (patch)
tree378b5d42024534e03b59fb67034e5f95d3e62e69 /src/veritysetup/veritysetup-generator.c
parentfileio: add read_stripped_line() as trivial read_line() + strstrip() combo (diff)
downloadsystemd-0ff6ff2b29dfb02a803515fb0160d9963d2389d5.tar.xz
systemd-0ff6ff2b29dfb02a803515fb0160d9963d2389d5.zip
tree-wide: port various parsers over to read_stripped_line()
Diffstat (limited to '')
-rw-r--r--src/veritysetup/veritysetup-generator.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/veritysetup/veritysetup-generator.c b/src/veritysetup/veritysetup-generator.c
index 59ff4cd7a5..d55d4aab0b 100644
--- a/src/veritysetup/veritysetup-generator.c
+++ b/src/veritysetup/veritysetup-generator.c
@@ -453,9 +453,9 @@ static int add_veritytab_devices(void) {
for (;;) {
_cleanup_free_ char *line = NULL, *name = NULL, *data_device = NULL, *hash_device = NULL,
*roothash = NULL, *options = NULL;
- char *l, *data_uuid, *hash_uuid;
+ char *data_uuid, *hash_uuid;
- r = read_line(f, LONG_LINE_MAX, &line);
+ r = read_stripped_line(f, LONG_LINE_MAX, &line);
if (r < 0)
return log_error_errno(r, "Failed to read %s: %m", arg_veritytab);
if (r == 0)
@@ -463,11 +463,10 @@ static int add_veritytab_devices(void) {
veritytab_line++;
- l = strstrip(line);
- if (IN_SET(l[0], 0, '#'))
+ if (IN_SET(line[0], 0, '#'))
continue;
- r = sscanf(l, "%ms %ms %ms %ms %ms", &name, &data_device, &hash_device, &roothash, &options);
+ r = sscanf(line, "%ms %ms %ms %ms %ms", &name, &data_device, &hash_device, &roothash, &options);
if (!IN_SET(r, 4, 5)) {
log_error("Failed to parse %s:%u, ignoring.", arg_veritytab, veritytab_line);
continue;