pipeline fix?
Test And Build / Lint (push) Successful in 6s
Test And Build / Build (push) Successful in 9s

This commit is contained in:
2026-08-07 16:10:22 +02:00
parent f5eba004fb
commit d4577d930c
+16 -4
View File
@@ -399,11 +399,23 @@ asynStatus turboPmacController::writeRead(int axisNo, const char *command,
command, getMsgPrintControl().getSuffix());
}
/*
The literal part of the message below is 113 bytes long. Cap the two
embedded strings (constexpr precision) so that the message always fits
into drvMessageText (MAXBUF_ bytes), otherwise the
-Wformat-truncation check would be triggered.
*/
constexpr size_t msgLiteralLen =
sizeof("Received unexpected response '' (carriage returns are "
"replaced with spaces) for command . Please call the "
"support") -
1;
constexpr size_t msgArgLen = (MAXBUF_ - msgLiteralLen - 1) / 2;
snprintf(drvMessageText, sizeof(drvMessageText),
"Received unexpected response '%s' (carriage returns "
"are replaced with spaces) for command %s. "
"Please call the support",
modResponse, command);
"Received unexpected response '%.*s' (carriage returns "
"are replaced with spaces) for command %.*s. Please call "
"the support",
(int)msgArgLen, modResponse, (int)msgArgLen, command);
status = asynError;
} else {
getMsgPrintControl().resetCount(numResponsesKey, pasynUser());