listattr: Make sure attributes are properly terminated
* This reduces garbage in the output, especially with 0 byte string types.
This commit is contained in:
parent
95e5e933ab
commit
194b772d8c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004-2015, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Copyright 2004-2020, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Copyright 2002, Ryan Fleet.
|
||||
*
|
||||
* Distributed under the terms of the MIT license.
|
||||
@ -76,6 +76,7 @@ show_attr_contents(BNode& node, const char* attribute, const attr_info& info)
|
||||
size);
|
||||
return;
|
||||
}
|
||||
buffer[min_c(bytesRead, kLimit - 1)] = '\0';
|
||||
|
||||
switch (info.type) {
|
||||
case B_INT8_TYPE:
|
||||
|
Loading…
Reference in New Issue
Block a user