Mercurial > mplayer.hg
diff libmpdemux/tv.c @ 3612:a1522fa7728a
x = malloc(strlen(s) + c) ... strcpy(x, s)
replaced by
x = strdup(s)
Note: sometimes c was 0 and that was a bug
Note2: code still has to be added to check the returned value of these funcs
author | pl |
---|---|
date | Wed, 19 Dec 2001 13:03:22 +0000 |
parents | a73b02e35e70 |
children | 3717145636b5 |
line wrap: on
line diff
--- a/libmpdemux/tv.c Wed Dec 19 12:54:06 2001 +0000 +++ b/libmpdemux/tv.c Wed Dec 19 13:03:22 2001 +0000 @@ -343,8 +343,7 @@ mp_msg(MSGT_TV, MSGL_INFO, " comment: %s\n", tvh->info->comment); params = malloc(sizeof(tvi_param_t)*2); - params[0].opt = malloc(strlen("input")); - sprintf((char *)params[0].opt, "input"); + params[0].opt = strdup("input"); params[0].value = malloc(sizeof(int)); (int)*(void **)params[0].value = tv_param_input; params[1].opt = params[1].value = NULL;