We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f6a3412 + 69a3ce1 commit 4cb3384Copy full SHA for 4cb3384
libs/androidfw/AssetManager.cpp
@@ -98,6 +98,24 @@ namespace {
98
99
return path;
100
}
101
+
102
+ /*
103
+ * Like strdup(), but uses C++ "new" operator instead of malloc.
104
+ */
105
+ static char* strdupNew(const char* str)
106
+ {
107
+ char* newStr;
108
+ int len;
109
110
+ if (str == NULL)
111
+ return NULL;
112
113
+ len = strlen(str);
114
+ newStr = new char[len+1];
115
+ memcpy(newStr, str, len+1);
116
117
+ return newStr;
118
+ }
119
120
121
/*
0 commit comments