Commit a5616c5d authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

oups forgot the str length in snprintf

parent 3cf5aff6
......@@ -34,7 +34,7 @@ public:
const char* print(const char format[], Params... args ){
const size_t length = 512;
char* name = new char[length+1];
snprintf(name, format, args...);
snprintf(name, length, format, args...);
name[length] = '\0';
return name;
......@@ -43,7 +43,7 @@ public:
const char* add(const char* strToCpy){
const size_t length = strlen(strToCpy);
char* cpy = new char[length+1];
memcpy(cpy, strToCpy, length);
memcpy(cpy, length, strToCpy, length);
cpy[length] = '\0';
return cpy;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment