check for available space in GetName

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@253 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2002-01-02 20:56:22 +00:00
parent 3962e559aa
commit 7064c42fc1
6 changed files with 23 additions and 17 deletions

View File

@@ -574,7 +574,7 @@ ArrayToList(register Term *tp, int nof)
}
int
GetName(char *s, Term t)
GetName(char *s, UInt max, Term t)
{
register Term Head;
register Int i;
@@ -590,6 +590,9 @@ GetName(char *s, Term t)
return (FALSE);
*s++ = i;
t = TailOfTerm(t);
if (--max == 0) {
Error(FATAL_ERROR,t,"not enough space for GetName");
}
}
*s = '\0';
return (TRUE);