src/gedlib/misc.c
/*========================================
 * addat -- Add @'s to both ends of string
 *  returns static buffer
 *======================================*/
- Add @'s to both ends of string
returns static buffer
- Add @ ' s to both ends of string returns static buffer
STRING
addat (STRING str)
{
#define ADDAT_SIZE 3
	static char buffer[ADDAT_SIZE][32];
	static INT dex = 0;
	STRING p;
	addat_count++;
	dex++;
	if (dex == ADDAT_SIZE) dex = 0;
	p = buffer[dex];
	snprintf(p, sizeof(buffer[dex]), "@%s@", str);
	return p;
}
STRING addat ( STRING str ) { #define ADDAT_SIZE  3 static char buffer [ ADDAT_SIZE ] [ 32 ] ; static INT dex = 0 ; STRING p ; addat_count ++ ; dex ++ ; if ( dex == ADDAT_SIZE ) dex = 0 ; p = buffer [ dex ] ; snprintf ( p , sizeof ( buffer [ dex ] ) , " " , str ) ; return p ; }
addat -- Add @'s to both ends of string
  returns static buffer
addat -- Add @ ' s to both ends of string returns static buffer
/*
	 * This static buffer is an array of buffers that can be used for
	 * addat'ed strings.  We need to use an array here since we may have
	 * multiple calls within a single operation and we don't want to overwrite
	 * values that haven't been copied or otherwise made permanent.
	 * Since GEDCOM 5.5 spefies that XREF values can be up to 22 chars,
	 * the static buffer needs to be at least 22+2+1=25 chars, but leave a
	 * little extra.
	 *
	 * Currently we need to support up to 3 addat() calls.
	 */