mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
chg: printandlogex now deals with string which has inital newline char.
This commit is contained in:
parent
cd93f3a134
commit
c41013d394
12 changed files with 53 additions and 46 deletions
12
client/ui.c
12
client/ui.c
|
@ -87,17 +87,25 @@ void PrintAndLogEx(logLevel_t level, char *fmt, ...) {
|
|||
}
|
||||
|
||||
if (strchr(buffer, '\n')) {
|
||||
|
||||
const char delim[2] = "\n";
|
||||
|
||||
token = strtok(buffer, "\n");
|
||||
// line starts with newline
|
||||
if (buffer[0] == '\n')
|
||||
PrintAndLog("");
|
||||
|
||||
token = strtok(buffer, delim);
|
||||
|
||||
while (token != NULL) {
|
||||
|
||||
size = strlen(buffer2);
|
||||
|
||||
if (strlen(token))
|
||||
snprintf(buffer2+size, sizeof(buffer2)-size, "%s%s\n", prefix, token);
|
||||
else
|
||||
snprintf(buffer2+size, sizeof(buffer2)-size, "\n");
|
||||
|
||||
token = strtok(NULL, "\n");
|
||||
token = strtok(NULL, delim);
|
||||
}
|
||||
PrintAndLog(buffer2);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue