aboutsummaryrefslogtreecommitdiff
path: root/src/core/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/string.c')
-rw-r--r--src/core/string.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/core/string.c b/src/core/string.c
index 9a1b9b7..364c4cf 100644
--- a/src/core/string.c
+++ b/src/core/string.c
@@ -321,9 +321,9 @@ char * strstr ( const char *haystack, const char *needle ) {
*
* @v dest Destination string
* @v src Source string
- * @ret dest Destination string
+ * @ret dnul Terminating NUL of destination string
*/
-char * strcpy ( char *dest, const char *src ) {
+char * stpcpy ( char *dest, const char *src ) {
const uint8_t *src_bytes = ( ( const uint8_t * ) src );
uint8_t *dest_bytes = ( ( uint8_t * ) dest );
@@ -333,6 +333,19 @@ char * strcpy ( char *dest, const char *src ) {
if ( ! *dest_bytes )
break;
}
+ return ( ( char * ) dest_bytes );
+}
+
+/**
+ * Copy string
+ *
+ * @v dest Destination string
+ * @v src Source string
+ * @ret dest Destination string
+ */
+char * strcpy ( char *dest, const char *src ) {
+
+ stpcpy ( dest, src );
return dest;
}