Commit b4c0cfe3 authored by Jisi Liu's avatar Jisi Liu

Add malloc cast

parent fd31899f
......@@ -54,8 +54,8 @@ namespace compiler {
namespace {
char* portable_strdup(const char* s) {
char* ns = malloc(strlen(s) + 1);
if (ns) {
char* ns = (char*) malloc(strlen(s) + 1);
if (ns != NULL) {
strcpy(ns, s);
}
return ns;
......
Markdown is supported
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