[libc] Another fix to add a null-terminator to the pthread name.

This fix is similar to the one done in https://reviews.llvm.org/D148844.
This miss was caught by the risv64 builder.

Differential Revision: https://reviews.llvm.org/D148871
This commit is contained in:
Siva Chandra Reddy 2023-04-21 03:29:36 +00:00
parent 7d98590b3a
commit 596d87c4cc

View File

@ -358,7 +358,7 @@ int Thread::get_name(cpp::StringStream &name) const {
int retval = __llvm_libc::syscall_impl(SYS_prctl, PR_GET_NAME, name_buffer);
if (retval < 0)
return -retval;
name << name_buffer;
name << name_buffer << cpp::StringStream::ENDS;
return 0;
}