relationals: fix -Wformat-truncation warning (#1918)

`inOrderStr` and `outOrderStr` are both written into `orderName`,
which may not fit as all three are the same size.  Decrease the sizes
of `inOrderStr` and `outOrderStr`.  The new sizes are still
sufficiently large to hold the result of `get_order_string`.

This commit only affects the error path and does not change the
printed output.  Error logs before and after this commit should not
differ.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2024-03-20 13:54:50 +01:00
committed by GitHub
parent 0deddf2ce7
commit 049b719eea

View File

@@ -245,7 +245,7 @@ const char *get_order_string( ShuffleOrder &order, size_t vecSize, cl_uint lengt
char * get_order_name( ExplicitType vecType, size_t inVecSize, size_t outVecSize, ShuffleOrder &inOrder, ShuffleOrder &outOrder, cl_uint lengthToUse, MTdata d, bool inUseNumerics, bool outUseNumerics )
{
static char orderName[ 512 ] = "";
char inOrderStr[ 512 ], outOrderStr[ 512 ];
char inOrderStr[64], outOrderStr[64];
if( inVecSize == 1 )
inOrderStr[ 0 ] = 0;