Attempt to avoid gcc 7.1 truncation complaints
diff --git a/tests/testcase.c b/tests/testcase.c
index 8d9a53e..ceb55f5 100644
--- a/tests/testcase.c
+++ b/tests/testcase.c
@@ -77,15 +77,17 @@
}
char nameBuffer[1024];
- snprintf(nameBuffer,
- sizeof(nameBuffer),
- "%s_%s_to_%s_qp%d_%d_speed%d",
- basenameBuffer,
- choiceToString(tc->encodeChoice),
- choiceToString(tc->decodeChoice),
- tc->minQuantizer,
- tc->maxQuantizer,
- tc->speed);
+ if (snprintf(nameBuffer,
+ sizeof(nameBuffer),
+ "%s_%s_to_%s_qp%d_%d_speed%d",
+ basenameBuffer,
+ choiceToString(tc->encodeChoice),
+ choiceToString(tc->decodeChoice),
+ tc->minQuantizer,
+ tc->maxQuantizer,
+ tc->speed) < 0) {
+ nameBuffer[0] = 0;
+ }
nameBuffer[sizeof(nameBuffer) - 1] = 0;
if (tc->name) {
free(tc->name);