From edb58721b8f7fd76b5dfa3bf83c683f2e266abd3 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 12 Aug 1997 20:16:25 +0000 Subject: Fix pgproc names over 15 chars in output. Add strNcpy() function. remove some (void) casts that are unnecessary. --- src/include/c.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/include/c.h') 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 * ---------------------------------------------------------------- -- cgit v1.2.3