Fix strcpy()

'nough said. It was broken since 2006.

Change-Id: I312ac07eee65d6bb8567851dd38064c7f51b3bd2
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/2062
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix@chromium.org>
This commit is contained in:
Stefan Reinauer 2012-12-19 11:22:07 -08:00 committed by Stefan Reinauer
parent f50fbe82ad
commit 2c3f2609ca
1 changed files with 6 additions and 1 deletions

View File

@ -69,10 +69,15 @@ static inline char *strncpy(char *to, const char *from, int count)
return ret; return ret;
} }
static inline void strcpy(char *dst, const char *src) static inline char *strcpy(char *dst, const char *src)
{ {
char *ptr = dst;
while (*src) while (*src)
*dst++ = *src++; *dst++ = *src++;
*dst = '\0';
return ptr;
} }
static inline int strcmp(const char *s1, const char *s2) static inline int strcmp(const char *s1, const char *s2)