From f1cc5cf0324fd7d5a8be041a0d797db1d1e6fb32 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Sun, 24 May 2009 18:15:05 -0600 Subject: [PATCH] Actually fix hddtemp parsing. --- src/hddtemp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hddtemp.c b/src/hddtemp.c index a622f6bb..5b1e22e7 100644 --- a/src/hddtemp.c +++ b/src/hddtemp.c @@ -84,10 +84,10 @@ static char *read_hdd_val(const char *line) char *ret = NULL; if (line) { - snprintf(line_s, 512, "%s", line); + if (!snprintf(line_s, 512, "%s", line)) return ret; p = line_s; } - if (!(*line_s)) + if (!(*line_s) || !p) return ret; /* read the device */ dev = ++p;