listattr: Make sure attributes are properly terminated
* This reduces garbage in the output, especially with 0 byte string types.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-2015, Axel Dörfler, [email protected].
|
* Copyright 2004-2020, Axel Dörfler, [email protected].
|
||||||
* Copyright 2002, Ryan Fleet.
|
* Copyright 2002, Ryan Fleet.
|
||||||
*
|
*
|
||||||
* Distributed under the terms of the MIT license.
|
* 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);
|
size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
buffer[min_c(bytesRead, kLimit - 1)] = '\0';
|
||||||
|
|
||||||
switch (info.type) {
|
switch (info.type) {
|
||||||
case B_INT8_TYPE:
|
case B_INT8_TYPE:
|
||||||
|
|||||||
Reference in New Issue
Block a user