/* A strdup whose allocations are freed after code generation is over. This is used by the lexical analyzer, so it can't longjmp; it just returns NULL on an allocation error, and the callers must check for it.  */
char* sdup(compiler_state_t *cstate, const char *s)
/* A strdup whose allocations are freed after code generation is over. This is used by the lexical analyzer, so it can't longjmp; it just returns NULL on an allocation error, and the callers must check for it.  */
char* sdup(compiler_state_t *cstate, const char *s)
{
	size_t n = strlen(s) + 1;
	char *cp = newchunk_nolongjmp(cstate, n);
	if (cp == NULL)
		return (NULL);
	pcap_strlcpy(cp, s, n);
	return (cp);
}