Merge branch 'android-4.9-q' of https://android.googlesource.com/kernel/common into lineage-17.1-caf-sdm845
* 'android-4.9-q' of https://android.googlesource.com/kernel/common: (1829 commits) Conflicts: arch/mips/include/uapi/asm/Kbuild arch/powerpc/include/uapi/asm/Kbuild drivers/irqchip/irq-gic.c drivers/scsi/ufs/ufs_quirks.h drivers/scsi/ufs/ufshcd.c drivers/usb/dwc3/core.c drivers/usb/gadget/function/f_accessory.c fs/ext4/namei.c include/uapi/drm/Kbuild include/uapi/linux/Kbuild include/uapi/linux/cifs/Kbuild include/uapi/linux/genwqe/Kbuild mm/page_alloc.c net/ipv6/datagram.c net/netfilter/xt_quota2.c net/netlink/genetlink.c sound/core/compress_offload.c Change-Id: I42de3248e9c43e504df5c9bb4139cbf355d2d7de
This commit is contained in:
commit
b441756bdb
1 changed files with 15952 additions and 7495 deletions
24
lib/string.c
24
lib/string.c
|
|
@ -235,6 +235,30 @@ ssize_t strscpy(char *dest, const char *src, size_t count)
|
|||
EXPORT_SYMBOL(strscpy);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* stpcpy - copy a string from src to dest returning a pointer to the new end
|
||||
* of dest, including src's %NUL-terminator. May overrun dest.
|
||||
* @dest: pointer to end of string being copied into. Must be large enough
|
||||
* to receive copy.
|
||||
* @src: pointer to the beginning of string being copied from. Must not overlap
|
||||
* dest.
|
||||
*
|
||||
* stpcpy differs from strcpy in a key way: the return value is a pointer
|
||||
* to the new %NUL-terminating character in @dest. (For strcpy, the return
|
||||
* value is a pointer to the start of @dest). This interface is considered
|
||||
* unsafe as it doesn't perform bounds checking of the inputs. As such it's
|
||||
* not recommended for usage. Instead, its definition is provided in case
|
||||
* the compiler lowers other libcalls to stpcpy.
|
||||
*/
|
||||
char *stpcpy(char *__restrict__ dest, const char *__restrict__ src);
|
||||
char *stpcpy(char *__restrict__ dest, const char *__restrict__ src)
|
||||
{
|
||||
while ((*dest++ = *src++) != '\0')
|
||||
/* nothing */;
|
||||
return --dest;
|
||||
}
|
||||
EXPORT_SYMBOL(stpcpy);
|
||||
|
||||
#ifndef __HAVE_ARCH_STRCAT
|
||||
/**
|
||||
* strcat - Append one %NUL-terminated string to another
|
||||
|
|
|
|||
Loading…
Reference in a new issue