From 28dc9a6a7bfd6137e5ed7945e16e9faa88788b91 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 13 Feb 2015 18:48:16 +0100 Subject: [PATCH] Be more flexible when parsing smartctl output --- cmdline/support.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmdline/support.c b/cmdline/support.c index eef723c6..181f0815 100644 --- a/cmdline/support.c +++ b/cmdline/support.c @@ -610,9 +610,9 @@ int smartctl_attribute(FILE* f, uint64_t* smart, char* serial) } } } else if (inside) { - if (sscanf(s, "%u %*s %*s %*u %*u %*u %*s %*s %*s %" SCNu64, &id, &raw) != 2) { + if (sscanf(s, "%u %*s %*s %*s %*s %*s %*s %*s %*s %" SCNu64, &id, &raw) != 2) { /* LCOV_EXCL_START */ - ferr("Invalid smartctl line '%s'.\n", buf); + ferr("Invalid smartctl line '%s'.\n", s); return -1; /* LCOV_EXCL_STOP */ }