Add cast to test 'string_simple' to avoid C++ compiler error.
This commit is contained in:
parent
36679865f4
commit
093f8995a8
1 changed files with 1 additions and 1 deletions
|
|
@ -6,7 +6,7 @@
|
|||
#include <string.h>
|
||||
const char* copy_string(const char* str) {
|
||||
size_t len = strlen(str);
|
||||
char* newstring = malloc(len + 1);
|
||||
char* newstring = (char*) malloc(len + 1);
|
||||
strcpy(newstring, str);
|
||||
return newstring;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue