/* This is the bad way to do things :) */
while (*list)
list++;
- *list = strdup (str);
+ *list = Safe_strdup (str);
if (!*list)
{
werror (E_OUT_OF_MEM, __FILE__, 0);
scratchFileName[strlen(scratchFileName) - strlen(buffer)] = '\0';
- return gc_strdup (scratchFileName);
+ return Safe_strdup (scratchFileName);
}
/** Returns true if the given path exists.
void
setMainValue (const char *pname, const char *pvalue)
{
+ assert(pname);
+ assert(pvalue);
+
shash_add (&_mainValues, pname, pvalue);
}
void
buildCmdLine2 (char *pbuffer, const char *pcmd)
{
- char *poutcmd = msprintf(_mainValues, pcmd);
+ char *poutcmd;
+ assert(pbuffer && pcmd);
+ assert(_mainValues);
+
+ poutcmd = msprintf(_mainValues, pcmd);
strcpy(pbuffer, poutcmd);
}
_mainValues = populateStringHash(ppin);
}
-char *
-gc_strdup (const char *s)
-{
- char *ret;
- ret = Safe_alloc ( strlen (s) + 1);
- strcpy (ret, s);
- return ret;
-}
-
/** Returns true if sz starts with the string given in key.
*/
bool
*nl = '\0';
}
+hTab *
+getRuntimeVariables(void)
+{
+ return _mainValues;
+}