From b9662dbc100d150a4ce4e8be0538d3b32105d7f1 Mon Sep 17 00:00:00 2001 From: Anton Arapov Date: Mon, 7 Dec 2009 13:49:45 +0100 Subject: kerneloops: fix the linux kernel version identification version string can and by ')' in some of the reports --- lib/Plugins/KerneloopsSysLog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/Plugins/KerneloopsSysLog.cpp') diff --git a/lib/Plugins/KerneloopsSysLog.cpp b/lib/Plugins/KerneloopsSysLog.cpp index fdb4a02..0032d38 100644 --- a/lib/Plugins/KerneloopsSysLog.cpp +++ b/lib/Plugins/KerneloopsSysLog.cpp @@ -52,7 +52,9 @@ static int extract_version(const char *linepointer, char *version) start = strstr((char*)linepointer, "2.6."); if (start) { - end = strchrnul(start, ' '); + end = strchrnul(start, ')'); + if (!end) + end = strchrnul(start, ' '); strncpy(version, start, end-start); ret = 1; } -- cgit From 9513842bf37190147941e11990b303dd83df4655 Mon Sep 17 00:00:00 2001 From: Anton Arapov Date: Mon, 7 Dec 2009 15:13:45 +0100 Subject: kerneloops: fix the linux kernel version identification 2nd try. change copypasted strchrnul() to strchr()... so that it will work. Credits to Denys. --- lib/Plugins/KerneloopsSysLog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Plugins/KerneloopsSysLog.cpp') diff --git a/lib/Plugins/KerneloopsSysLog.cpp b/lib/Plugins/KerneloopsSysLog.cpp index 0032d38..adff846 100644 --- a/lib/Plugins/KerneloopsSysLog.cpp +++ b/lib/Plugins/KerneloopsSysLog.cpp @@ -52,7 +52,7 @@ static int extract_version(const char *linepointer, char *version) start = strstr((char*)linepointer, "2.6."); if (start) { - end = strchrnul(start, ')'); + end = strchr(start, ')'); if (!end) end = strchrnul(start, ' '); strncpy(version, start, end-start); -- cgit