]> git.baikalelectronics.ru Git - kernel.git/commit
Provide a function to create a NUL-terminated string from unterminated data
authorDavid Howells <dhowells@redhat.com>
Tue, 4 Jul 2017 16:25:02 +0000 (17:25 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 6 Jul 2017 07:27:09 +0000 (03:27 -0400)
commit4ac87c03d8819116b02da3b4d863dc24059bfeb0
tree5d8e536fc716419fe3b9474dcacb92c6f055930f
parent6be65a3b675d4708a2b4badedeee62b730947417
Provide a function to create a NUL-terminated string from unterminated data

Provide a function, kmemdup_nul(), that will create a NUL-terminated string
from an unterminated character array where the length is known in advance.

This is better than kstrndup() in situations where we already know the
string length as the strnlen() in kstrndup() is superfluous.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
include/linux/string.h
mm/util.c