2011-06-28 17:24:00 +00:00
|
|
|
--- a/util.c
|
|
|
|
+++ b/util.c
|
|
|
|
@@ -146,16 +146,16 @@ int get_linux_version()
|
|
|
|
{
|
|
|
|
struct utsname name;
|
|
|
|
char *cp;
|
|
|
|
- int a,b,c;
|
|
|
|
+ int a = 0, b = 0,c = 0;
|
|
|
|
if (uname(&name) <0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
cp = name.release;
|
2011-06-14 19:26:25 +00:00
|
|
|
a = strtoul(cp, &cp, 10);
|
2011-06-28 17:24:00 +00:00
|
|
|
- if (*cp != '.') return -1;
|
|
|
|
- b = strtoul(cp+1, &cp, 10);
|
2011-06-14 19:26:25 +00:00
|
|
|
- if (*cp != '.') return -1;
|
|
|
|
- c = strtoul(cp+1, NULL, 10);
|
2011-06-28 17:24:00 +00:00
|
|
|
+ if (*cp == '.')
|
|
|
|
+ b = strtoul(cp+1, &cp, 10);
|
|
|
|
+ if (*cp == '.')
|
|
|
|
+ c = strtoul(cp+1, &cp, 10);
|
2011-06-14 19:26:25 +00:00
|
|
|
|
|
|
|
return (a*1000000)+(b*1000)+c;
|
|
|
|
}
|