OSSP CVS Repository

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

ossp-pkg/rc/rc_config.c 1.12 -> 1.13

--- rc_config.c  2002/04/22 15:22:39     1.12
+++ rc_config.c  2002/04/23 12:30:29     1.13
@@ -32,7 +32,8 @@
 #include <string.h>
 
 #include "rc.h"
-#include "rc_const.h"               /* String constants                 */
+#include "str.h"
+#include "rc_const.h"               /* String constants                     */
 
 static int m_nLocks = 0;            /* Server locks, not thread-safe FIXME  */
 static char *m_szSummary = NULL;    /* Configuration summary storage        */
@@ -127,18 +128,10 @@
                 /* FIXME Unportable kludge to ensure storage FIXME */
                 m_szSummary = realloc(m_szSummary, sizeof("OptionXXis") + \
                     sizeof(configGetname(i)) + sizeof(configGetval(i) + 8));
-                if (!(strcmp(configGetval(i), "1"))) {
-                    strcat(m_szSummary, "Option ");
-                    strcat(m_szSummary, configGetname(i));
-                    strcat(m_szSummary, " is on.\n");
-                }
-                else {
-                    strcat(m_szSummary, "Option ");
-                    strcat(m_szSummary, configGetname(i));
-                    strcat(m_szSummary, " is ");
-                    strcat(m_szSummary, configGetval(i));
-                    strcat(m_szSummary, ".\n");
-                }
+                if (!(strcmp(configGetval(i), "1")))
+                    str_concat(m_szSummary, "Option ", configGetname(i), " is on.\n");
+                else
+                    str_concat(m_szSummary, "Option ", configGetname(i), " is ", configGetval(i), ".\n");
             }
         }           /* FIXME Not threadsafe, wrap with crit section */
         ex_catch(Except) {  /* Breaks the otherwise endless loop above */

CVSTrac 2.0.1