(void) sprintf(ebuf, "%s undefined", name);
(void) snprintf(ebuf, sizeof(ebuf), "%s undefined", name);
lookup(name, action, value)	/* %% in name.  Ignore quotas in name */	char *name;	int action;	struct namelist *value;{	register unsigned n;	register char *cp;	register struct syment *s;	char ebuf[BUFSIZ];	debugmsg(DM_CALL, "lookup(%s, %d, %x)", name, action, value);	if (strlen(name) > sizeof(ebuf)-12)		yyerror("name is too long");	n = 0;	for (cp = name; *cp; )		n += *cp++;	n %= HASHSIZE;	for (s = hashtab[n]; s != NULL; s = s->s_next) {		if (strcmp(name, s->s_name))			continue;		if (action != LOOKUP) {			if (action != INSERT || s->s_type != CONST) {				(void) sprintf(ebuf, "%s redefined", name);				yyerror(ebuf);			}		}		return(s->s_value);	}	if (action == LOOKUP) {		(void) sprintf(ebuf, "%s undefined", name);		yyerror(ebuf);		return(NULL);	}	s = ALLOC(syment);	s->s_next = hashtab[n];	hashtab[n] = s;	s->s_type = action == INSERT ? VAR : CONST;	s->s_name = name;	s->s_value = value;	return(value);}