diff options
Diffstat (limited to 'src/include/c.h')
-rw-r--r-- | src/include/c.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/include/c.h b/src/include/c.h index e02f5f9fd56..eaf1ee7b03a 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: c.h,v 1.13 1997/05/17 16:25:57 mergl Exp $ + * $Id: c.h,v 1.14 1997/08/12 20:16:17 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -29,7 +29,7 @@ * 5) IsValid macros for system types * 6) offsetof, lengthof, endof * 7) exception handling definitions, Assert, Trap, etc macros - * 8) Min, Max, Abs macros + * 8) Min, Max, Abs, strNcpy macros * 9) externs * 10) Berkeley-specific defs * 11) system-specific hacks @@ -681,6 +681,14 @@ typedef struct Exception { */ #define Abs(x) ((x) >= 0 ? (x) : -(x)) +/* + * strNcpy -- + * Does string copy, and forces terminating NULL + */ +/* we do this so if the macro is used in an if action, it will work */ +#define strNcpy(dest,src,len) do \ + {strncpy((dest),(src),(len));*((dest) + (len)) = '\0';} while (0) + /* ---------------------------------------------------------------- * Section 9: externs * ---------------------------------------------------------------- |