mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-06-03 19:41:41 +00:00
Merge pull request #3011 from kormax/satisfy-old-compilers
Remove direct use of strndup to support older compilers
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "cmdparser.h" // command_t
|
||||
#include "commonutil.h" // ARRAYLEN
|
||||
#include "comms.h" // clearCommandBuffer
|
||||
#include "util.h" // str_ndup
|
||||
#include "cmdtrace.h"
|
||||
#include "cliparser.h"
|
||||
#include "cmdhfmf.h"
|
||||
@@ -575,7 +576,7 @@ static int parse_ecp_subcommand(const char *cmd, uint8_t *frame, size_t frame_si
|
||||
size_t second_term_len = p - second_term;
|
||||
char *second = NULL;
|
||||
if (second_term_len > 0) {
|
||||
second = strndup(second_term, second_term_len);
|
||||
second = str_ndup(second_term, second_term_len);
|
||||
}
|
||||
|
||||
// Skip whitespace
|
||||
@@ -593,7 +594,7 @@ static int parse_ecp_subcommand(const char *cmd, uint8_t *frame, size_t frame_si
|
||||
}
|
||||
size_t third_term_len = p - third_term;
|
||||
if (third_term_len > 0) {
|
||||
third = strndup(third_term, third_term_len);
|
||||
third = str_ndup(third_term, third_term_len);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user