Add stpcpy()

This commit is contained in:
Gregory Nutt
2014-01-09 14:08:48 -06:00
parent 75390a49a4
commit 4e2c140124
4 changed files with 57 additions and 42 deletions
+15 -3
View File
@@ -1,7 +1,7 @@
/************************************************************************
* libc/string/lib_strcpy.c
*
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009, 2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -42,11 +42,23 @@
#include <string.h>
/************************************************************************
* Global Functions
* Public Functions
************************************************************************/
/************************************************************************
* Name: strcpy
*
* Description:
* Copies the string pointed to by 'src' (including the terminating NUL
* character) into the array pointed to by 'des'.
*
* Returned value:
* The strcpy() function returns the 'dest' pointer
*
************************************************************************/
#ifndef CONFIG_ARCH_STRCPY
char *strcpy(char *dest, const char *src)
FAR char *strcpy(FAR char *dest, FAR const char *src)
{
char *tmp = dest;
while ((*dest++ = *src++) != '\0');