Stairs/src/charproperties.cpp
Mark van Renswoude f87a8b6eb7 Changed from UDP to HTTP
Implemented access point, station mode and basic web configuration page
Actual lighting control is completely broken
2018-01-01 19:56:07 +01:00

26 lines
517 B
C++

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