From a67354cd84ea27d885214d71a7cbf48fbc340bfd Mon Sep 17 00:00:00 2001 From: anschrammh Date: Thu, 17 Dec 2020 08:20:31 +0100 Subject: [PATCH] Added a comment about why not using the strdup c function --- src/app/AbstractParser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/AbstractParser.cpp b/src/app/AbstractParser.cpp index 015dbc2..ed1999d 100644 --- a/src/app/AbstractParser.cpp +++ b/src/app/AbstractParser.cpp @@ -2,6 +2,7 @@ AbstractParser::AbstractParser(const char *resource) : _resource(NULL) { + //Could use strdup instead, but has bigger flash memory footprint :(, sticking to this technique instead. _resource = (char *) malloc((strlen(resource) * sizeof(char)) + 1); //+1 for the string terminating character strcpy(_resource, resource); }