loader/svg: Fix empty id to null

empty id is invalid. Therefore, set it to null and make it is not used.

issue: https://github.com/thorvg/thorvg/issues/1977
This commit is contained in:
JunsuChoi 2024-02-14 10:52:54 +09:00 committed by Hermet Park
parent b7a57e65c1
commit b400512fda

View file

@ -89,6 +89,7 @@ static char* _skipSpace(const char* str, const char* end)
static char* _copyId(const char* str)
{
if (!str) return nullptr;
if (strlen(str) == 0) return nullptr;
return strdup(str);
}