~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mystrings/stpncpy.c

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
/*
17
 
    stpncpy(dst,src,length) moves length characters, or until end, of src to
 
17
    my_stpncpy(dst,src,length) moves length characters, or until end, of src to
18
18
    dst and appends a closing NUL to dst if src is shorter than length.
19
19
    The result is a pointer to the first NUL in dst, or is dst+n if dst was
20
20
    truncated.
22
22
 
23
23
#include "m_string.h"
24
24
 
25
 
char *stpncpy(register char *dst, register const char *src, size_t n)
 
25
char *my_stpncpy(register char *dst, register const char *src, size_t n)
26
26
{
27
27
  while (n-- != 0) {
28
28
    if (!(*dst++ = *src++)) {