[Ocfs2-tools-commits] smushran commits r854 - trunk/o2cb_ctl

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Apr 27 19:54:45 CDT 2005


Author: smushran
Signed-off-by: msingh
Date: 2005-04-27 19:54:43 -0500 (Wed, 27 Apr 2005)
New Revision: 854

Modified:
   trunk/o2cb_ctl/o2cb_config.c
Log:
handles whitespace after numbers when parsing cluster.conf
bugzilla#310
Signed-off-by: msingh

Modified: trunk/o2cb_ctl/o2cb_config.c
===================================================================
--- trunk/o2cb_ctl/o2cb_config.c	2005-04-27 22:43:29 UTC (rev 853)
+++ trunk/o2cb_ctl/o2cb_config.c	2005-04-28 00:54:43 UTC (rev 854)
@@ -99,6 +99,7 @@
     num_s = j_config_get_attribute(cfs, "number");
     if (!num_s || !*num_s)
         goto out_error;
+    g_strchomp(num_s);
     val = strtoul(num_s, &ptr, 10);
     if (!ptr || *ptr)
         goto out_error;
@@ -119,7 +120,10 @@
     port_s = j_config_get_attribute(cfs, "ip_port");
     if (!port_s || !*port_s)
         goto out_error;
+    g_strchomp(port_s);
     val = strtoul(port_s, &ptr, 10);
+    if (!ptr || *ptr)
+        goto out_error;
     rc = -ERANGE;
     if ((val == ULONG_MAX) || (val > UINT_MAX))
         goto out_error;
@@ -178,6 +182,7 @@
     count = j_config_get_attribute(c_cfs, "node_count");
     if (!count || !*count)
         goto out_error;
+    g_strchomp(count);
     val = strtoul(count, &ptr, 10);
     if (!ptr || *ptr)
         goto out_error;



More information about the Ocfs2-tools-commits mailing list