mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
fix: fflush(stdout), should sort out the blocking pipe problem
add: line length (@merlokk)
This commit is contained in:
parent
4da4b33d8d
commit
d30454fc5a
3 changed files with 18 additions and 19 deletions
|
@ -107,7 +107,7 @@ static void storeCommand(UsbCommand *command) {
|
|||
//If these two are equal, we're about to overwrite in the
|
||||
// circular buffer.
|
||||
PrintAndLogEx(FAILED, "WARNING: Command buffer about to overwrite command! This needs to be fixed!");
|
||||
fflush(NULL);
|
||||
fflush(stdout);
|
||||
}
|
||||
//Store the command at the 'head' location
|
||||
UsbCommand* destination = &rxBuffer[cmd_head];
|
||||
|
@ -185,7 +185,7 @@ static void UsbCommandReceived(UsbCommand* c) {
|
|||
} else {
|
||||
PrintAndLogEx(NORMAL, "#db# %s", s);
|
||||
}
|
||||
fflush(NULL);
|
||||
fflush(stdout);
|
||||
break;
|
||||
}
|
||||
case CMD_DEBUG_PRINT_INTEGERS: {
|
||||
|
@ -339,7 +339,7 @@ bool OpenProxmark(void *port, bool wait_for_port, int timeout, bool flash_mode)
|
|||
pthread_create(&USB_communication_thread, NULL, &uart_communication, &conn);
|
||||
//pthread_create(&FPC_communication_thread, NULL, &uart_communication, &conn);
|
||||
|
||||
fflush(NULL);
|
||||
fflush(stdout);
|
||||
// create a mutex to avoid interlacing print commands from our different threads
|
||||
//pthread_mutex_init(&print_lock, NULL);
|
||||
return true;
|
||||
|
|
|
@ -40,7 +40,7 @@ static void showBanner(void){
|
|||
printf("\nKeep iceman fork alive with a donation! https://paypal.me/iceman1001/");
|
||||
printf("\nMONERO: 43mNJLpgBVaTvyZmX9ajcohpvVkaRy1kbZPm8tqAb7itZgfuYecgkRF36rXrKFUkwEGeZedPsASRxgv4HPBHvJwyJdyvQuP");
|
||||
printf("\n\n\n");
|
||||
fflush(NULL);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -261,6 +261,8 @@ int main(int argc, char* argv[]) {
|
|||
/* initialize history */
|
||||
using_history();
|
||||
|
||||
rl_extend_line_buffer(1024);
|
||||
|
||||
if (argc < 2) {
|
||||
show_help(true, argv[0]);
|
||||
return 1;
|
||||
|
|
11
client/ui.c
11
client/ui.c
|
@ -27,14 +27,11 @@ void PrintAndLogOptions(char *str[][2], size_t size, size_t space) {
|
|||
size_t counts[2] = {0, 0};
|
||||
for (int i = 0; i < size; i++)
|
||||
for (int j = 0 ; j < 2 ; j++)
|
||||
if(counts[j] < strlen(str[i][j]))
|
||||
{
|
||||
if (counts[j] < strlen(str[i][j])) {
|
||||
counts[j] = strlen(str[i][j]);
|
||||
}
|
||||
for(int i = 0; i < size; i++)
|
||||
{
|
||||
for(int j = 0; j < 2; j++)
|
||||
{
|
||||
for (int i = 0; i < size; i++) {
|
||||
for (int j = 0; j < 2; j++) {
|
||||
if (j == 0)
|
||||
snprintf(format, sizeof(format), "%%%zus%%%zus", space, counts[j]);
|
||||
else
|
||||
|
@ -178,7 +175,7 @@ void PrintAndLog(char *fmt, ...) {
|
|||
va_end(argptr2);
|
||||
|
||||
if (flushAfterWrite)
|
||||
fflush(NULL);
|
||||
fflush(stdout);
|
||||
|
||||
//release lock
|
||||
pthread_mutex_unlock(&print_lock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue