Mercurial > mplayer.hg
changeset 1190:98f732a23cb4
egy hulye kis checking kimaradt az strcspn fv. jovoltabol
author | al3x |
---|---|
date | Thu, 21 Jun 2001 23:03:03 +0000 |
parents | 7c6bcb281966 |
children | f9a46e7843ee |
files | mplayer.c |
diffstat | 1 files changed, 14 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/mplayer.c Thu Jun 21 22:48:34 2001 +0000 +++ b/mplayer.c Thu Jun 21 23:03:03 2001 +0000 @@ -569,10 +569,13 @@ { size_t i2 = strlen(video_driver); - vo_subdevice = malloc(i2-i); - if (vo_subdevice != NULL) - strncpy(vo_subdevice, (char *)(video_driver+i+1), i2-i); - video_driver[i] = '\0'; + if (video_driver[i] == ':') + { + vo_subdevice = malloc(i2-i); + if (vo_subdevice != NULL) + strncpy(vo_subdevice, (char *)(video_driver+i+1), i2-i); + video_driver[i] = '\0'; + } // printf("video_driver: %s, subdevice: %s\n", video_driver, vo_subdevice); } if(!video_driver) @@ -595,10 +598,13 @@ { size_t i2 = strlen(audio_driver); - ao_subdevice = malloc(i2-i); - if (ao_subdevice != NULL) - strncpy(ao_subdevice, (char *)(audio_driver+i+1), i2-i); - audio_driver[i] = '\0'; + if (audio_driver[i] == ':') + { + ao_subdevice = malloc(i2-i); + if (ao_subdevice != NULL) + strncpy(ao_subdevice, (char *)(audio_driver+i+1), i2-i); + audio_driver[i] = '\0'; + } // printf("audio_driver: %s, subdevice: %s\n", audio_driver, ao_subdevice); } if(!audio_driver)