summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Larsson <catacombae@gmail.com>2021-03-07 14:46:59 +0000
committerErik Larsson <catacombae@gmail.com>2021-03-07 14:46:59 +0000
commit86dd5fea351a5a55bea26b7622eb85ebd6075a60 (patch)
tree6de3fe6c2668b36e6c642e8a5590ceebc15b0f83
parentf063fe08e424c99f133df18bf9dce49c851bcb0a (diff)
downloadsgdisk-86dd5fea351a5a55bea26b7622eb85ebd6075a60.tar.gz
gptpart.cc: Fix double byteswap for big-endian architectures.
The data in 'name' was already byteswapped by ReversePartBytes, so byteswapping it again in GetDescription returned each UTF-16BE unit back to UTF-16LE and caused seemingly garbage strings to be printed.
-rw-r--r--gptpart.cc1
1 files changed, 0 insertions, 1 deletions
diff --git a/gptpart.cc b/gptpart.cc
index b4f2698..b268cf0 100644
--- a/gptpart.cc
+++ b/gptpart.cc
@@ -92,7 +92,6 @@ string GPTPart::GetDescription(void) {
size_t pos = 0 ;
while ( ( pos < NAME_SIZE ) && ( name[ pos ] != 0 ) ) {
uint16_t cp = name[ pos ++ ] ;
- if ( ! IsLittleEndian() ) ReverseBytes( & cp , 2 ) ;
// first to utf32
uint32_t uni ;
if ( cp < 0xd800 || cp > 0xdfff ) {