strlcpy() and bsd/os - Mailing list pgsql-patches

From Bruce Momjian
Subject strlcpy() and bsd/os
Date
Msg-id 200609301209.k8UC9ek11915@momjian.us
Whole thread Raw
List pgsql-patches
BSD/OS doesn't have a prototype for strlcpy() but has the function, so I
worked around that with a define;  patch attached and applied.

--
  Bruce Momjian   bruce@momjian.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: src/include/port.h
===================================================================
RCS file: /cvsroot/pgsql/src/include/port.h,v
retrieving revision 1.100
diff -c -c -r1.100 port.h
*** src/include/port.h    27 Sep 2006 16:29:46 -0000    1.100
--- src/include/port.h    30 Sep 2006 12:03:52 -0000
***************
*** 332,338 ****
  extern char *strdup(const char *str);
  #endif

! #ifndef HAVE_STRLCPY
  extern size_t strlcpy(char *dst, const char *src, size_t siz);
  #endif

--- 332,338 ----
  extern char *strdup(const char *str);
  #endif

! #if !defined(HAVE_STRLCPY) || defined(bsdi) /* bsdi doesn't have the prototype */
  extern size_t strlcpy(char *dst, const char *src, size_t siz);
  #endif


pgsql-patches by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: pgrowlocks(2)
Next
From: Tom Lane
Date:
Subject: Re: Bad bug in fopen() wrapper code