* src/SDCCglue.h: make tmpfileNameSet available for preOutName
[fw/sdcc] / src / SDCCutil.c
index 73b0b7cc4d00610a70b559daf57ea4fc05f43b68..0247d8949e7e1529381bbf06fb9c4d0ec2ff42d2 100644 (file)
@@ -72,7 +72,6 @@ char *
 join(const char **pplist)
 {
   char *pinto = buffer;
-  *pinto = '\0';
 
   while (*pplist)
     {
@@ -81,6 +80,7 @@ join(const char **pplist)
       *pinto++ = ' ';
       pplist++;
     }
+  *pinto = '\0';
 
   return buffer;
 }
@@ -271,13 +271,20 @@ static hTab *_mainValues;
 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);
 }
 
@@ -306,3 +313,8 @@ chomp (char *sz)
     *nl = '\0';
 }
 
+hTab *
+getRuntimeVariables(void)
+{
+  return _mainValues;
+}