Fix timerGetSource() returning a string without a null terminator

This commit is contained in:
Rohan Singh
2015-08-16 13:58:23 -04:00
parent cd5087d222
commit 0efb943173
+1
View File
@@ -63,6 +63,7 @@ char* timerGetSource()
size_t length = strlen(timerLibSource);
char* copy = (char*)malloc(length + 1);
strncpy(copy, timerLibSource, length);
copy[length] = '\0';
return copy;
}