blob: 036e4be32107bd90c031ad5ce9c718ed915439c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/**
** @file strcpy.c
**
** @author Numerous CSCI-452 classes
**
** @brief C implementations of common library functions
*/
#ifndef STRCPY_SRC_INC
#define STRCPY_SRC_INC
#include <common.h>
#include <lib.h>
/**
** strcpy(dst,src) - copy a NUL-terminated string
**
** @param dst The destination buffer
** @param src The source buffer
**
** @return The dst parameter
**
** NOTE: assumes dst is large enough to hold the copied string
*/
char *strcpy( register char *dst, register const char *src ) {
register char *tmp = dst;
while( (*dst++ = *src++) )
;
return( tmp );
}
#endif
|