{
stringpair *cur, *pred;
- assert(root != NULL);
- assert(first != NULL);
- assert(second != NULL);
+ assert(!!root);
+ assert(!!first);
+ assert(!!second);
/* create a new node, and check whether all is okay */
if (!(cur = (stringpair *)malloc(sizeof(stringpair))))
return NULL;
{
stringpair *cur, *next;
- assert(root != NULL);
+ assert(!!root);
cur = root->next;
while (cur)
{
next = cur->next;
- assert(cur->first != NULL);
- assert(cur->second != NULL);
+ assert(!!cur->first);
+ assert(!!cur->second);
free(cur->first);
free(cur->second);
free(cur);
int result = 0;
assert(matchlength > 0); /* the function cannot handle zero-length comparison */
- assert(first != NULL);
+ assert(!!first);
while (cur && result <= 0)
{
result = (int)*cur->first - (int)*first;
{
stringpair *cur;
- assert(root != NULL);
+ assert(!!root);
cur = root;
while (cur->next)
{
if (cur->next == item)
{
cur->next = item->next; /* unlink from list */
- assert(item->first != NULL);
- assert(item->second != NULL);
+ assert(!!item->first);
+ assert(!!item->second);
free(item->first);
free(item->second);
free(item);
{
stringpair *cur;
- assert(name != NULL);
+ assert(!!name);
assert(strlen(name) <= sNAMEMAX);
- assert(alias != NULL);
+ assert(!!alias);
assert(strlen(alias) <= sEXPMAX);
if (!(cur = insert_stringpair(&alias_tab, name, alias, strlen(name))))
error(103); /* insufficient memory (fatal error) */
assert(strlen(cur->second) <= sEXPMAX);
strcpy(target, cur->second);
} /* if */
- return cur != NULL;
+ return !!cur;
}
void
{
stringlist *cur;
- assert(path != NULL);
+ assert(!!path);
if (!(cur = (stringlist *)malloc(sizeof(stringlist))))
error(103); /* insufficient memory (fatal error) */
if (!(cur->line = strdup(path)))
cur = cur->next;
if (cur)
{
- assert(cur->line != NULL);
+ assert(!!cur->line);
return cur->line;
} /* if */
return NULL;
while (cur)
{
next = cur->next;
- assert(cur->line != NULL);
+ assert(!!cur->line);
free(cur->line);
free(cur);
cur = next;
{
stringpair *cur;
- assert(pattern != NULL);
- assert(substitution != NULL);
+ assert(!!pattern);
+ assert(!!substitution);
if (!(cur = insert_stringpair(&substpair, pattern, substitution, prefixlen)))
error(103); /* insufficient memory (fatal error) */
adjustindex(*pattern);
{
stringpair *item;
- assert(name != NULL);
+ assert(!!name);
assert(length > 0);
assert((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z')
|| *name == '_');
{
stringpair *item;
- assert(name != NULL);
+ assert(!!name);
assert(length > 0);
assert((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z')
|| *name == '_');