#include "props.hxx"
+#include <algorithm>
+#include <stdio.h>
+#include <string.h>
+
#if PROPS_STANDALONE
#include <iostream>
#endif
-#include <algorithm>
-#include <stdio.h>
-#include <string.h>
-
\f
////////////////////////////////////////////////////////////////////////
// FIXME: potential buffer overflow.
// For some reason, strnlen and
// strncpy cause all kinds of crashes.
- string str = s;
- char * copy = new char[str.size() + 1];
- strcpy(copy, str.c_str());
+ char * copy = new char[strlen(s) + 1];
+ strcpy(copy, s);
return copy;
}
if (_tied) {
return _value.string_val->setValue(val);
} else {
- delete (char *)_local_val.string_val;
+ delete [] (char *)_local_val.string_val;
_local_val.string_val = copy_string(val);
return true;
}
delete _value.string_val;
_value.string_val = 0;
} else {
- delete (char *)_local_val.string_val;
+ delete [] (char *)_local_val.string_val;
}
_local_val.string_val = 0;
break;
*/
SGPropertyNode::~SGPropertyNode ()
{
- delete (char *)_name;
+ delete [] (char *)_name;
for (int i = 0; i < (int)_children.size(); i++) {
delete _children[i];
}