TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: THOMAS MAEDER
from: BOB STOUT
date: 1998-02-04 17:40:00
subject: Builder C++

On , Thomas Maeder (2:301/138@fidonet) wrote: 
 > Note that strncpy in general does *not* zero-terminate its target.
  Excerpted from SNIP_STR.H in SNIPPETS...
/*
**  Safe string macros by Keiichi Nakasato
*/
/* strncpy() variants that are guaranteed to append NUL                 */
#define strn1cpy(d,s,n) (strncpy(d,s,n),(d)[n]=0,d)
#define strn0cpy(d,s,n) strn1cpy(d,s,(n)-1)
/* like strcpy, except guaranteed to work with overlapping strings      */
#define strMove(d,s) memmove(d,s,strlen(s)+1) 
--- QM v1.00
---------------
* Origin: MicroFirm : Down to the C in chips (1:106/2000.6)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.