/* * Stairs * Copyright 2017 (c) Mark van Renswoude * * https://git.x2software.net/pub/Stairs */ #include "charproperties.h" #include #include #include "debug.h" void CharProperties::assignChar(char** field, const char* newValue) { if (*field != nullptr) delete *field; if (newValue != nullptr) { // Include the terminating null character size_t length = strlen(newValue) + 1; *field = new char[length]; strncpy(*field, newValue, length); } else *field = nullptr; }