Remove duplicate va_end()
This commit is contained in:
+3
-4
@@ -156,22 +156,21 @@ uint16_t hwFreeMem() {
|
||||
#ifdef MY_DEBUG
|
||||
void hwDebugPrint(const char *fmt, ... ) {
|
||||
if (MY_SERIALDEVICE) {
|
||||
char fmtBuffer[300];
|
||||
char fmtBuffer[MY_DEBUG_BUFFER_SIZE];
|
||||
#ifdef MY_GATEWAY_FEATURE
|
||||
// prepend debug message to be handled correctly by controller (C_INTERNAL, I_LOG_MESSAGE)
|
||||
snprintf(fmtBuffer, 299, PSTR("0;255;%d;0;%d;"), C_INTERNAL, I_LOG_MESSAGE);
|
||||
snprintf(fmtBuffer, sizeof(fmtBuffer), PSTR("0;255;%d;0;%d;"), C_INTERNAL, I_LOG_MESSAGE);
|
||||
MY_SERIALDEVICE.print(fmtBuffer);
|
||||
#endif
|
||||
va_list args;
|
||||
va_start (args, fmt );
|
||||
va_end (args);
|
||||
#ifdef MY_GATEWAY_FEATURE
|
||||
// Truncate message if this is gateway node
|
||||
vsnprintf(fmtBuffer, 60, fmt, args);
|
||||
fmtBuffer[59] = '\n';
|
||||
fmtBuffer[60] = '\0';
|
||||
#else
|
||||
vsnprintf(fmtBuffer, 299, fmt, args);
|
||||
vsnprintf(fmtBuffer, sizeof(fmtBuffer), fmt, args);
|
||||
#endif
|
||||
va_end (args);
|
||||
MY_SERIALDEVICE.print(fmtBuffer);
|
||||
|
||||
Reference in New Issue
Block a user