OSSP CVS Repository

ossp - Difference in ossp-pkg/rc/rc_script.c versions 1.27 and 1.28
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/rc/rc_script.c 1.27 -> 1.28

--- rc_script.c  2003/05/28 13:31:55     1.27
+++ rc_script.c  2003/05/28 14:25:56     1.28
@@ -215,7 +215,8 @@
             strncpy(szTemp, piStart, piEnd - piStart + 1);
             piSubtemp = strstr(szTemp, RC_DEF_PRG);
             if (piSubtemp) { /* Priority pattern found */
-                nTmp = (int)piSubtemp + strlen(RC_DEF_PRG);
+                for (nTmp = (int)piSubtemp + strlen(RC_DEF_PRG); \
+                    isspace(*(char *)nTmp); nTmp += sizeof (char)); /* Strip */
                 nPri = strtol((char *)nTmp, &piSep, 10);
                 if ((char *)nTmp == piSep)  /* No priority number follows */
                     RC_THROW(RC_ERR_USE);   /* which is an error */
@@ -228,11 +229,13 @@
             /* Handle the section userid   */
             piSubtemp = strstr(szTemp, RC_DEF_UIG);
             if (piSubtemp) { /* Userid pattern found */
-                nTmp = (int)piSubtemp + strlen(RC_DEF_UIG);
+                for (nTmp = (int)piSubtemp + strlen(RC_DEF_UIG); \
+                    isspace(*(char *)nTmp); nTmp += sizeof (char)); /* Strip */
                 nUid = strtol((char *)nTmp, &piSep, 10);
                 if ((char *)nTmp == piSep)      /* No userid number follows */
                 {
-                    nUserbytes = (strcspn(piSep, " \t\n") + sizeof (char)) * sizeof (char);
+                    nUserbytes = strspn((strcspn(piSep, " \t\n") * sizeof (char) + piSep), " \t\n");
+                    nUserbytes = (strlen(piSep) - nUserbytes + 1) * sizeof (char);
                     szUser = malloc(nUserbytes);
                     if (!szUser)
                         RC_THROW(RC_ERR_MEM);

CVSTrac 2.0.1