aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/strpcpy.c
blob: e181e78f7b8b27bca69c5c3ceffc138ed1656f7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * strpcpy.c
 *
 * strpcpy() - strcpy() which returns a pointer to the final null
 */

#include <string.h>

char *strpcpy(char *dst, const char *src)
{
  char *q = dst;
  const char *p = src;
  char ch;

  do {
    *q++ = ch = *p++;
  } while ( ch );

  return q-1;
}