Fix issue with parsing /dev/kmsg time, off by one error
Problem and proposed fix reported by opty on #troglobit at freenode. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
parent
b115c7ec4e
commit
f54c1d1f30
@ -1128,8 +1128,8 @@ void printsys(char *msg)
|
||||
while (isdigit(*++p))
|
||||
;
|
||||
++p;
|
||||
while (isdigit(*++p))
|
||||
buffer.timestamp.usec = 10 * buffer.timestamp.usec + (*p - '0');
|
||||
while (isdigit(*p))
|
||||
buffer.timestamp.usec = 10 * buffer.timestamp.usec + (*p++ - '0');
|
||||
now += buffer.timestamp.usec / 1000000;
|
||||
buffer.timestamp.usec = buffer.timestamp.usec % 1000000;
|
||||
localtime_r(&now, &buffer.timestamp.tm);
|
||||
|
Loading…
x
Reference in New Issue
Block a user