From 41f4d5111faefdf6451f739731ed7f03c7156ac1 Mon Sep 17 00:00:00 2001 From: kormax <3392860+kormax@users.noreply.github.com> Date: Sun, 2 Nov 2025 23:13:03 +0200 Subject: [PATCH] Remove direct use of strndup to support older compilers --- client/src/cmdhf14a.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index bae5cbb50..34b1c3c51 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -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); } }