aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/strpcpy.c
blob: a4fd2a060043b9dee1fdf4d3ffa1f21b0e5ddb21 (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;
}