Skip to content

Commit b8ab121

Browse files
committed
BUG: VTKPolyDataMeshIO Write should use signed char for CHAR
Both `VTKPolyDataMeshIO::WritePoints` and `VTKPolyDataMeshIO::WritePointData` originally casted the `buffer` to plain `char *` for component type `CHAR` (using `CASE_INVOKE_WITH_COMPONENT_TYPE`). However, `CHAR` indicates that the component type is _signed_ char, whereas the default `char` might be unsigned. Follow-up to pull request #5470 commit 70fbb2b "BUG: MINCImageIO should use `signed char` for `CHAR` and `MI_TYPE_BYTE`"
1 parent 0f1f022 commit b8ab121

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/IO/MeshVTK/src/itkVTKPolyDataMeshIO.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,7 @@ VTKPolyDataMeshIO::WriteMeshInformation()
16961696
} \
16971697
case IOComponentEnum::CHAR: \
16981698
{ \
1699-
function(outputFile, static_cast<char *>(buffer), " char"); \
1699+
function(outputFile, static_cast<signed char *>(buffer), " char"); \
17001700
break; \
17011701
} \
17021702
case IOComponentEnum::USHORT: \

0 commit comments

Comments
 (0)