File:  [CSRG BSD Unix] / 43BSD / ingres / source / gutil / ztack.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43
BSD 4.3

# include	<sccs.h>
# include	<useful.h>

SCCSID(@(#)ztack.c	8.2	2/8/85)

/*
**  LOCAL STRING CONCATENATE
**	Strings `a' and `b' are concatenated and left in an
**	internal buffer.  A pointer to that buffer is returned.
**
**	Ztack can be called recursively as:
**		ztack(ztack(ztack(w, x), y), z);
*/

char *
ztack(a, b)
register char	*a, *b;
{
	register char	*c;
	static char	buf[CONCAT_BUFSZ];
	
	c = buf;
	
	while (*a)
		*c++ = *a++;
	while (*b)
		*c++ = *b++;
	*c = '\0';
	if (buf[CONCAT_BUFSZ - 1] != 0)
		syserr("ztack overflow: %s", buf);
	return (buf);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.