No need to reinvent strdup...
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Mon, 7 Jan 2008 21:06:50 +0000 (21:06 +0000)
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Mon, 7 Jan 2008 21:06:50 +0000 (21:06 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@25644 b3059339-0415-0410-9bf9-f77b7e298cf2

libass/ass_library.c

index 9c41c1d..4c4e89f 100644 (file)
@@ -90,8 +90,7 @@ void ass_add_font(ass_library_t* priv, char* name, char* data, int size)
                return;
        grow_array((void**)&priv->fontdata, priv->num_fontdata, sizeof(*priv->fontdata));
        
-       priv->fontdata[idx].name = malloc(strlen(name));
-       strcpy(priv->fontdata[idx].name, name);
+       priv->fontdata[idx].name = strdup(name);
        
        priv->fontdata[idx].data = malloc(size);
        memcpy(priv->fontdata[idx].data, data, size);