Remove use of non-standard function strdup

Related to #873.
This commit is contained in:
Camilla Löwy
2018-01-17 11:56:35 +01:00
parent bb3ab87a18
commit 973bf29622
11 changed files with 29 additions and 19 deletions
+15
View File
@@ -138,10 +138,25 @@ static void terminate(void)
}
//////////////////////////////////////////////////////////////////////////
////// GLFW internal API //////
//////////////////////////////////////////////////////////////////////////
char* _glfw_strdup(const char* source)
{
const size_t length = strlen(source);
char* result = calloc(length + 1, 1);
strcpy(result, source);
return result;
}
//////////////////////////////////////////////////////////////////////////
////// GLFW event API //////
//////////////////////////////////////////////////////////////////////////
// Notifies shared code of an error
//
void _glfwInputError(int code, const char* format, ...)
{
_GLFWerror* error;