Added a comment about why not using the strdup c function

This commit is contained in:
anschrammh 2020-12-17 08:20:31 +01:00
parent 2cf047f4ff
commit a67354cd84

View File

@ -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);
}