chg: swapped banner placement\nchg: console -c prompt got [con].

This commit is contained in:
iceman1001 2020-01-04 19:59:36 +01:00
commit eb2130af4b
3 changed files with 9 additions and 9 deletions

View file

@ -150,7 +150,7 @@ main_loop(char *script_cmds_file, char *script_cmd, bool stayInCommandLoop) {
// loops every time enter is pressed... // loops every time enter is pressed...
while (1) { while (1) {
bool printprompt = false; bool printprompt = false;
const char *prompt = PROXPROMPT; const char *prompt = PROXPROMPT_CON;
check_script: check_script:
// If there is a script file // If there is a script file
@ -765,10 +765,6 @@ int main(int argc, char *argv[]) {
if (session.stdinOnTTY && session.stdoutOnTTY) if (session.stdinOnTTY && session.stdoutOnTTY)
session.supports_colors = true; session.supports_colors = true;
#endif #endif
// ascii art only in interactive client
if (!script_cmds_file && !script_cmd && session.stdinOnTTY && session.stdoutOnTTY && !flash_mode)
showBanner();
// Let's take a baudrate ok for real UART, USB-CDC & BT don't use that info anyway // Let's take a baudrate ok for real UART, USB-CDC & BT don't use that info anyway
if (speed == 0) if (speed == 0)
speed = USART_BAUD_RATE; speed = USART_BAUD_RATE;
@ -819,6 +815,10 @@ int main(int argc, char *argv[]) {
if (!session.pm3_present) if (!session.pm3_present)
PrintAndLogEx(INFO, "Running in " _YELLOW_("OFFLINE") "mode. Check " _YELLOW_("\"%s -h\"") " if it's not what you want.\n", exec_name); PrintAndLogEx(INFO, "Running in " _YELLOW_("OFFLINE") "mode. Check " _YELLOW_("\"%s -h\"") " if it's not what you want.\n", exec_name);
// ascii art only in interactive client
if (!script_cmds_file && !script_cmd && session.stdinOnTTY && session.stdoutOnTTY && !flash_mode)
showBanner();
#ifdef HAVE_GUI #ifdef HAVE_GUI
# ifdef _WIN32 # ifdef _WIN32

View file

@ -14,7 +14,7 @@
#include "common.h" #include "common.h"
#define PROXPROMPT "pm3 --> " #define PROXPROMPT_CON "[con] pm3 --> "
#define PROXPROMPT_USB "[usb] pm3 --> " #define PROXPROMPT_USB "[usb] pm3 --> "
#define PROXPROMPT_FPC "[fpc] pm3 --> " #define PROXPROMPT_FPC "[fpc] pm3 --> "
#define PROXPROMPT_OFFLINE "[offline] pm3 --> " #define PROXPROMPT_OFFLINE "[offline] pm3 --> "

View file

@ -919,10 +919,10 @@ void strcreplace(char *buf, size_t len, char from, char to) {
} }
char *strmcopy(const char *src) { char *strmcopy(const char *src) {
char *dest = (char *) calloc(strlen(src) + 1, sizeof(uint8_t)); int len = strlen(src) + 1;
char *dest = (char *) calloc(len, sizeof(uint8_t));
if (dest != NULL) { if (dest != NULL) {
memset(dest, 0, strlen(src) + 1); strncat(dest, src, len);
strncat(dest, src, strlen(dest));
} }
return dest; return dest;
} }