Skip to content

Commit

Permalink
lib/string.c: use the name "C-string" in comments
Browse files Browse the repository at this point in the history
For strncpy() and friends the source string may or may not have an actual
NUL character at the end.  The documentation is confusing in this because
it specifically mentions that you are passing a "NUL-terminated" string.
Wikipedia says that "C-string" is an alternative name we can use instead.

http://en.wikipedia.org/wiki/Null-terminated_string

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Dan Carpenter authored and torvalds committed Jun 4, 2014
1 parent a8fe19e commit 0046dd9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ EXPORT_SYMBOL(strcpy);

#ifndef __HAVE_ARCH_STRNCPY
/**
* strncpy - Copy a length-limited, %NUL-terminated string
* strncpy - Copy a length-limited, C-string
* @dest: Where to copy the string to
* @src: Where to copy the string from
* @count: The maximum number of bytes to copy
Expand Down Expand Up @@ -136,7 +136,7 @@ EXPORT_SYMBOL(strncpy);

#ifndef __HAVE_ARCH_STRLCPY
/**
* strlcpy - Copy a %NUL terminated string into a sized buffer
* strlcpy - Copy a C-string into a sized buffer
* @dest: Where to copy the string to
* @src: Where to copy the string from
* @size: size of destination buffer
Expand Down Expand Up @@ -182,7 +182,7 @@ EXPORT_SYMBOL(strcat);

#ifndef __HAVE_ARCH_STRNCAT
/**
* strncat - Append a length-limited, %NUL-terminated string to another
* strncat - Append a length-limited, C-string to another
* @dest: The string to be appended to
* @src: The string to append to it
* @count: The maximum numbers of bytes to copy
Expand Down Expand Up @@ -211,7 +211,7 @@ EXPORT_SYMBOL(strncat);

#ifndef __HAVE_ARCH_STRLCAT
/**
* strlcat - Append a length-limited, %NUL-terminated string to another
* strlcat - Append a length-limited, C-string to another
* @dest: The string to be appended to
* @src: The string to append to it
* @count: The size of the destination buffer.
Expand Down

0 comments on commit 0046dd9

Please sign in to comment.