summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2012-12-19 11:22:07 -0800
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-01-03 00:56:59 +0100
commit2c3f2609ca30f6303cec9639bacf1eb40aeee213 (patch)
tree003797127e3af5b7f9648069f3ab5c2a20d266b8 /src
parentf50fbe82ad0837ae7b30d7e2a5570ffc0dcc3950 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/include/string.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/include/string.h b/src/include/string.h
index 708961b635..44f244c733 100644
--- a/src/include/string.h
+++ b/src/include/string.h
@@ -69,10 +69,15 @@ static inline char *strncpy(char *to, const char *from, int count)
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)
*dst++ = *src++;
+ *dst = '\0';
+
+ return ptr;
}
static inline int strcmp(const char *s1, const char *s2)