diff --git a/client/proxmark3.c b/client/proxmark3.c index 76048952f..d582bafc0 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -169,7 +169,7 @@ check_script: // remove linebreaks strcleanrn(script_cmd_buf, sizeof(script_cmd_buf)); - cmd = strdup(script_cmd_buf); + cmd = str_dup(script_cmd_buf); if (cmd != NULL) printprompt = true; } @@ -177,7 +177,7 @@ check_script: // If there is a script command if (execCommand) { - cmd = strdup(script_cmd); + cmd = str_dup(script_cmd); if (cmd != NULL) printprompt = true; @@ -206,7 +206,7 @@ check_script: // remove linebreaks strcleanrn(script_cmd_buf, sizeof(script_cmd_buf)); - cmd = strdup(script_cmd_buf); + cmd = str_dup(script_cmd_buf); if (cmd != NULL) printprompt = true; diff --git a/client/util.c b/client/util.c index 41ee8f0d8..226255536 100644 --- a/client/util.c +++ b/client/util.c @@ -919,10 +919,10 @@ void strcreplace(char *buf, size_t len, char from, char to) { } -char *strdup(const char *src) { - return strndup(src, strlen(src)); +char *str_dup(const char *src) { + return str_ndup(src, strlen(src)); } -char *strndup(const char *src, size_t len) { +char *str_ndup(const char *src, size_t len) { char *dest = (char *) calloc(len + 1, sizeof(uint8_t)); if (dest != NULL) { diff --git a/client/util.h b/client/util.h index b5a4be4a6..21db9198f 100644 --- a/client/util.h +++ b/client/util.h @@ -99,7 +99,7 @@ bool str_endswith(const char *s, const char *suffix); // check for suffix in void clean_ascii(unsigned char *buf, size_t len); void strcleanrn(char *buf, size_t len); void strcreplace(char *buf, size_t len, char from, char to); -char *strdup(const char *src); -char *strndup(const char *src, size_t len); +char *str_dup(const char *src); +char *str_ndup(const char *src, size_t len); int hexstring_to_u96(uint32_t *hi2, uint32_t *hi, uint32_t *lo, const char *str); #endif