From 8d60415d0ff1fd01d65e9d57291e6fd5c454959c Mon Sep 17 00:00:00 2001 From: Mika Laitio Date: Sat, 30 Oct 2010 21:06:41 +0300 Subject: [PATCH] fix the parsing of counter value --- src/W1CounterDevice.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/W1CounterDevice.cc b/src/W1CounterDevice.cc index d339562..5e343bf 100644 --- a/src/W1CounterDevice.cc +++ b/src/W1CounterDevice.cc @@ -59,10 +59,10 @@ string W1CounterDevice::get_value() { while(getline(ifs, value_line)) { length = value_line.length(); if (length > 0) { - pos = value_line.find("c="); + pos = value_line.find("crc=YES c="); if ((pos >= 0) && - (pos + 2 < length)) { - value_line = value_line.substr(pos + 2); + (pos + 10 < length)) { + value_line = value_line.substr(pos + 10); } else { value_line = ""; -- 2.41.0