blob: e2c76d73c94c1e7ba5b528b560fa657aedd726e2 (
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
36
|
/**
** @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
|