]> git.baikalelectronics.ru Git - kernel.git/commit
seq_buf: Add seq_buf_terminate() API
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 17 Mar 2021 17:34:35 +0000 (13:34 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 18 Mar 2021 16:58:27 +0000 (12:58 -0400)
commit49bc71d3915fc30b6d63bd43c2951e7c5baae3b4
treefc2134522f8dad91f3f04851695c603fc0e61a4d
parent9957643b1975167c0faeb9cdfdee0d1de90f2d60
seq_buf: Add seq_buf_terminate() API

In the case that the seq_buf buffer needs to be printed directly, add a way
to make sure that the buffer is safe to read by forcing a nul terminating
character at the end of the string, or the last byte of the buffer if the
string has overflowed.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
include/linux/seq_buf.h