projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added xa51 Visual Studio 6.0 project files
[fw/sdcc]
/
src
/
SDCCutil.c
diff --git
a/src/SDCCutil.c
b/src/SDCCutil.c
index edbe8e6e7fc15869fbb306e66262c81d0e5c7e7f..75475d3db84dc76b4e9fec14efc7c05becf532c4 100644
(file)
--- a/
src/SDCCutil.c
+++ b/
src/SDCCutil.c
@@
-55,7
+55,7
@@
addToList (const char **list, const char *str)
/* This is the bad way to do things :) */
while (*list)
list++;
/* 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);
if (!*list)
{
werror (E_OUT_OF_MEM, __FILE__, 0);
@@
-253,7
+253,7
@@
getPrefixFromBinPath (const char *prel)
scratchFileName[strlen(scratchFileName) - strlen(buffer)] = '\0';
scratchFileName[strlen(scratchFileName) - strlen(buffer)] = '\0';
- return
gc
_strdup (scratchFileName);
+ return
Safe
_strdup (scratchFileName);
}
/** Returns true if the given path exists.
}
/** Returns true if the given path exists.
@@
-271,13
+271,20
@@
static hTab *_mainValues;
void
setMainValue (const char *pname, const char *pvalue)
{
void
setMainValue (const char *pname, const char *pvalue)
{
+ assert(pname);
+ assert(pvalue);
+
shash_add (&_mainValues, pname, pvalue);
}
void
buildCmdLine2 (char *pbuffer, const char *pcmd)
{
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);
}
strcpy(pbuffer, poutcmd);
}
@@
-287,15
+294,6
@@
populateMainValues (const char **ppin)
_mainValues = populateStringHash(ppin);
}
_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
/** Returns true if sz starts with the string given in key.
*/
bool
@@
-315,3
+313,8
@@
chomp (char *sz)
*nl = '\0';
}
*nl = '\0';
}
+hTab *
+getRuntimeVariables(void)
+{
+ return _mainValues;
+}