aboutsummaryrefslogtreecommitdiffstats
path: root/lib/string.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-08 14:31:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-08 14:31:16 -0400
commit3f17ea6dea8ba5668873afa54628a91aaa3fb1c0 (patch)
treeafbeb2accd4c2199ddd705ae943995b143a0af02 /lib/string.c
parent1860e379875dfe7271c649058aeddffe5afd9d0d (diff)
parent1a5700bc2d10cd379a795fd2bb377a190af5acd4 (diff)
Merge branch 'next' (accumulated 3.16 merge window patches) into master
Now that 3.15 is released, this merges the 'next' branch into 'master', bringing us to the normal situation where my 'master' branch is the merge window. * accumulated work in next: (6809 commits) ufs: sb mutex merge + mutex_destroy powerpc: update comments for generic idle conversion cris: update comments for generic idle conversion idle: remove cpu_idle() forward declarations nbd: zero from and len fields in NBD_CMD_DISCONNECT. mm: convert some level-less printks to pr_* MAINTAINERS: adi-buildroot-devel is moderated MAINTAINERS: add linux-api for review of API/ABI changes mm/kmemleak-test.c: use pr_fmt for logging fs/dlm/debug_fs.c: replace seq_printf by seq_puts fs/dlm/lockspace.c: convert simple_str to kstr fs/dlm/config.c: convert simple_str to kstr mm: mark remap_file_pages() syscall as deprecated mm: memcontrol: remove unnecessary memcg argument from soft limit functions mm: memcontrol: clean up memcg zoneinfo lookup mm/memblock.c: call kmemleak directly from memblock_(alloc|free) mm/mempool.c: update the kmemleak stack trace for mempool allocations lib/radix-tree.c: update the kmemleak stack trace for radix tree allocations mm: introduce kmemleak_update_trace() mm/kmemleak.c: use %u to print ->checksum ...
Diffstat (limited to 'lib/string.c')
-rw-r--r--lib/string.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/lib/string.c b/lib/string.c
index 9b1f9062a202..992bf30af759 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -107,7 +107,7 @@ EXPORT_SYMBOL(strcpy);
107 107
108#ifndef __HAVE_ARCH_STRNCPY 108#ifndef __HAVE_ARCH_STRNCPY
109/** 109/**
110 * strncpy - Copy a length-limited, %NUL-terminated string 110 * strncpy - Copy a length-limited, C-string
111 * @dest: Where to copy the string to 111 * @dest: Where to copy the string to
112 * @src: Where to copy the string from 112 * @src: Where to copy the string from
113 * @count: The maximum number of bytes to copy 113 * @count: The maximum number of bytes to copy
@@ -136,7 +136,7 @@ EXPORT_SYMBOL(strncpy);
136 136
137#ifndef __HAVE_ARCH_STRLCPY 137#ifndef __HAVE_ARCH_STRLCPY
138/** 138/**
139 * strlcpy - Copy a %NUL terminated string into a sized buffer 139 * strlcpy - Copy a C-string into a sized buffer
140 * @dest: Where to copy the string to 140 * @dest: Where to copy the string to
141 * @src: Where to copy the string from 141 * @src: Where to copy the string from
142 * @size: size of destination buffer 142 * @size: size of destination buffer
@@ -182,7 +182,7 @@ EXPORT_SYMBOL(strcat);
182 182
183#ifndef __HAVE_ARCH_STRNCAT 183#ifndef __HAVE_ARCH_STRNCAT
184/** 184/**
185 * strncat - Append a length-limited, %NUL-terminated string to another 185 * strncat - Append a length-limited, C-string to another
186 * @dest: The string to be appended to 186 * @dest: The string to be appended to
187 * @src: The string to append to it 187 * @src: The string to append to it
188 * @count: The maximum numbers of bytes to copy 188 * @count: The maximum numbers of bytes to copy
@@ -211,7 +211,7 @@ EXPORT_SYMBOL(strncat);
211 211
212#ifndef __HAVE_ARCH_STRLCAT 212#ifndef __HAVE_ARCH_STRLCAT
213/** 213/**
214 * strlcat - Append a length-limited, %NUL-terminated string to another 214 * strlcat - Append a length-limited, C-string to another
215 * @dest: The string to be appended to 215 * @dest: The string to be appended to
216 * @src: The string to append to it 216 * @src: The string to append to it
217 * @count: The size of the destination buffer. 217 * @count: The size of the destination buffer.
@@ -301,6 +301,24 @@ char *strchr(const char *s, int c)
301EXPORT_SYMBOL(strchr); 301EXPORT_SYMBOL(strchr);
302#endif 302#endif
303 303
304#ifndef __HAVE_ARCH_STRCHRNUL
305/**
306 * strchrnul - Find and return a character in a string, or end of string
307 * @s: The string to be searched
308 * @c: The character to search for
309 *
310 * Returns pointer to first occurrence of 'c' in s. If c is not found, then
311 * return a pointer to the null byte at the end of s.
312 */
313char *strchrnul(const char *s, int c)
314{
315 while (*s && *s != (char)c)
316 s++;
317 return (char *)s;
318}
319EXPORT_SYMBOL(strchrnul);
320#endif
321
304#ifndef __HAVE_ARCH_STRRCHR 322#ifndef __HAVE_ARCH_STRRCHR
305/** 323/**
306 * strrchr - Find the last occurrence of a character in a string 324 * strrchr - Find the last occurrence of a character in a string