*/
# ifndef USEDMALLOC
-# include <stdlib.h>
/*@-mustdefine@*/
}
else
{
+ /* drl
+ fix this so message doesn't run out of
+ memory*/
+
+ llbuglit("Out of memory");
+
llfatalerrorLoc
(message ("Out of memory. Allocating %w bytes at %s:%d.",
size_toLongUnsigned (size),
cstring_fromChars (name), line));
+
}
}
void mstring_markFree (char *s)
{
- sfreeEventually (s);
+ sfreeEventually (s);
}
char *mstring_spaces (int n)
return FALSE;
}
}
+
+bool mstring_containsString (const char *s, const char *c)
+{
+ if (mstring_isDefined (s))
+ {
+ return (strstr (s, c) != NULL);
+ }
+ else
+ {
+ return FALSE;
+ }
+}
char *mstring_concat (const char *s1, const char *s2)
{
char
char_fromInt (int x)
{
- llassert ((x >= (int)'\0') && (x <= (int)'~'));
+ /*
+ ** evans 2001-09-28 - changed assertion in response to Anthony Giorgio's comment
+ ** that the old assertions failed for EBCDIC character set. Now we just check
+ ** that the result is equal.
+ */
- return ((char) x);
+ char res = (char) x;
+ llassert ((int) res == x);
+ return res;
}
/*@-czechfcns@*/