~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mystrings/strnmov.c

MergeĀ fromĀ Jim

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
 
    my_stpncpy(dst,src,length) moves length characters, or until end, of src to
 
17
    strnmov(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 *my_stpncpy(register char *dst, register const char *src, size_t n)
 
25
char *strnmov(register char *dst, register const char *src, size_t n)
26
26
{
27
27
  while (n-- != 0) {
28
28
    if (!(*dst++ = *src++)) {