- allow scriptcontext objects to be dynamic

- enhancements in scriptcontext (error messages stored as properties)
This commit is contained in:
zolliker
2009-02-19 13:30:32 +00:00
parent 981534624f
commit 35f2b6b810
33 changed files with 753 additions and 310 deletions

View File

@ -259,6 +259,12 @@ const char *StringDictGetNext(pStringDict self, char *pValue, int iValLen)
} else {
LLDnodeDataTo(self->iList, &sVal);
strncpy(pValue, sVal.value, iValLen);
/* strncpy is not guaranteed to be '\0' terminated */
if (iValLen > 0 && pValue[iValLen-1] != '\0') {
/* overflow */
pValue[iValLen-1] = '\0';
}
return sVal.name;
}
} else { /* start a new one */
@ -270,6 +276,11 @@ const char *StringDictGetNext(pStringDict self, char *pValue, int iValLen)
self->iTraverse = 1;
LLDnodeDataTo(self->iList, &sVal);
strncpy(pValue, sVal.value, iValLen);
/* strncpy is not guaranteed to be '\0' terminated */
if (iValLen > 0 && pValue[iValLen-1] != '\0') {
/* overflow */
pValue[iValLen-1] = '\0';
}
return sVal.name;
}
}