#ifndef EXTERNAL_PRINTANDLOG
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <stdarg.h>
#include <readline/readline.h>
#include <pthread.h>
}
PrintAndLog(buffer2);
} else {
- snprintf(buffer2, sizeof(buffer2), "%s%s", prefix, buffer);
+ snprintf(buffer2, sizeof(buffer2), "%s%.*s", prefix, MAX_PRINT_BUFFER - 20, buffer);
PrintAndLog(buffer2);
}
}