Commit 36bd859a authored by Bernd Eckenfels's avatar Bernd Eckenfels

deal with 2-digits kernel versions as reported in Bug#7.

https://sourceforge.net/p/net-tools/bugs/7/
parent e8165523
...@@ -33,11 +33,11 @@ void *xrealloc(void *oldp, size_t sz) ...@@ -33,11 +33,11 @@ void *xrealloc(void *oldp, size_t sz)
int kernel_version(void) int kernel_version(void)
{ {
struct utsname uts; struct utsname uts;
int major, minor, patch; int major, minor, patch=0;
if (uname(&uts) < 0) if (uname(&uts) < 0)
return -1; return -1;
if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) != 3) if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) < 2)
return -1; return -1;
return KRELEASE(major, minor, patch); return KRELEASE(major, minor, patch);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment