seq_buf: Add seq_buf_terminate() API
mainline inclusion from mainline-v5.13-rc1 commit f2616c77 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8C7BS Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f2616c772c768485de18e7fcb2816bcdcd098339 ------------------------------------------------- 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> Signed-off-by:
Lu Jialin <lujialin4@huawei.com>
Loading
Please sign in to comment