Fix checking of string::npos in sensor type parsing

The current string parsing to get sensor type from the path
does not correctly check for string::npos after the calls
to rfind().  This change adds proper string::npos checking
after each rfind() before the position is used.

Tested: Ran 'ipmitool sensor list' and confirmed that the
sensor units are displayed properly.

Change-Id: If9a7113d105fdf7f4450a22d4b881cf2b5a9c090
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
1 file changed