OSSP CVS Repository

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

ossp-pkg/rc/rc_anal.c 1.4 -> 1.5

--- rc_anal.c    2002/06/05 16:24:20     1.4
+++ rc_anal.c    2002/06/26 14:11:16     1.5
@@ -42,7 +42,8 @@
 {
     rc_anal_t *pNew = NULL;
 
-    pNew = malloc(sizeof(rc_anal_t));
+    /* Allocate storage for 1 anal object */
+    pNew = calloc(1, sizeof(rc_anal_t));
     return(pNew);
 }
 
@@ -52,10 +53,10 @@
 ************************************************/
 rc_return_t analRcs(rc_anal_t **ppInst, const char *kszName)
 {
-    if (!kszName)
-        TRACE("Error codition, NULL passed as argument");
-/* FIXME Das ist very broken!  */
+    if (!kszName) {
+        (*ppInst)->m_szRcs = NULL;
 /*        RC_THROW(RC_WRN_NUL);*/
+    }
     else { /* Only enter block with valid string, strdup can't handle NULL */
         (*ppInst)->m_szRcs = strdup(kszName);
     }
@@ -65,13 +66,12 @@
 
 /************************************************
 * private analTmp(rc_anal_t **, const char *)   *
-* Read a temp file to use for analysis          *
+* Read a temp file to analyze                   *
 ************************************************/
 rc_return_t analTmp(rc_anal_t **ppInst, const char *kszName)
 {
     if (!kszName) {
-        TRACE("Error codition, NULL passed as argument");
-/* FIXME Das ist very broken!  */
+        (*ppInst)->m_szTmp = NULL;
 /*        RC_THROW(RC_WRN_NUL);*/
     }
     else { /* Only enter block with valid string, strdup can't handle NULL */
@@ -87,10 +87,10 @@
 ************************************************/
 rc_return_t analFuncs(rc_anal_t **ppInst, const char *kszName)
 {
-    if (!kszName)
-        TRACE("Error codition, NULL passed as argument");
-/* FIXME Das ist very broken!  */
+    if (!kszName) {
+        (*ppInst)->m_szFuncs = NULL;
 /*        RC_THROW(RC_WRN_NUL);*/
+    }
     else { /* Only enter block with valid string, strdup can't handle NULL */
         (*ppInst)->m_szFuncs = strdup(kszName);
     }
@@ -104,10 +104,10 @@
 ************************************************/
 rc_return_t analLocs(rc_anal_t **ppInst, const char *kszPathexpr)
 {
-    if (!kszPathexpr)
-        TRACE("Error codition, NULL passed as argument");
-/* FIXME Das ist very broken!  */
+    if (!kszPathexpr) {
+        (*ppInst)->m_szLocs = NULL;
 /*        RC_THROW(RC_WRN_NUL);*/
+    }
     else { /* Only enter block with valid string, strdup can't handle NULL */
         (*ppInst)->m_szLocs = strdup(kszPathexpr);
     }
@@ -123,16 +123,16 @@
 {
     ex_t Except;
 
-    if (!pkszVector)
-        TRACE("Error codition, NULL passed as argument");
-/* FIXME Das ist very broken!  */
-/*        RC_THROW(RC_WRN_NUL);*/
+    if (!pkszVector) {
+        RC_THROW(RC_WRN_NUL);
+    }
 
     ex_try {    /* Sections are a vector, so we must copy accordingly */
         (*ppInst)->m_pszSecs = vectorCopy(pkszVector);
     }
     ex_catch(Except) {
-        rethrow;
+TRACE("VectorCopy broke");
+/*        rethrow;*/
     }
 
     return(RC_THROW(RC_OK));
@@ -155,7 +155,8 @@
         analSecs (&pInst, configGetsecs());
     }
     ex_catch(Except) {
-        rethrow;
+TRACE("Parsing broke");
+/*        rethrow;*/
     }
 
     return(RC_THROW(RC_OK));

CVSTrac 2.0.1