Mercurial > mplayer.hg
comparison stream/stream_cue.c @ 33432:4ecf8f0b024c
Simplify by using av_strlcpy.
author | reimar |
---|---|
date | Sun, 29 May 2011 12:23:38 +0000 |
parents | cdc8cec139ad |
children | a010c375947c |
comparison
equal
deleted
inserted
replaced
33431:cdc8cec139ad | 33432:4ecf8f0b024c |
---|---|
222 snprintf(s,sizeof( s ),"%s/%s",bincue_path,bin_filename); | 222 snprintf(s,sizeof( s ),"%s/%s",bincue_path,bin_filename); |
223 cur_name = s; | 223 cur_name = s; |
224 break; | 224 break; |
225 case 2: | 225 case 2: |
226 /* now I would say the whole filename is shit, build our own */ | 226 /* now I would say the whole filename is shit, build our own */ |
227 strncpy(s, cue_filename, strlen(cue_filename) - 3 ); | 227 av_strlcpy(s, cue_filename, strlen(cue_filename) - 3 ); |
228 s[strlen(cue_filename) - 3] = '\0'; | 228 strcat(s, ".bin"); |
229 strcat(s, "bin"); | |
230 cur_name = s; | 229 cur_name = s; |
231 break; | 230 break; |
232 case 3: | 231 case 3: |
233 /* ok try it with path */ | 232 /* ok try it with path */ |
234 snprintf(t, sizeof( t ), "%s/%s", bincue_path, s); | 233 snprintf(t, sizeof( t ), "%s/%s", bincue_path, s); |
235 cur_name = t; | 234 cur_name = t; |
236 break; | 235 break; |
237 case 4: | 236 case 4: |
238 /* now I would say the whole filename is shit, build our own */ | 237 /* now I would say the whole filename is shit, build our own */ |
239 strncpy(s, cue_filename, strlen(cue_filename) - 3 ); | 238 av_strlcpy(s, cue_filename, strlen(cue_filename) - 3 ); |
240 s[strlen(cue_filename) - 3] = '\0'; | 239 strcat(s, ".img"); |
241 strcat(s, "img"); | |
242 cur_name = s; | 240 cur_name = s; |
243 break; | 241 break; |
244 case 5: | 242 case 5: |
245 /* ok try it with path */ | 243 /* ok try it with path */ |
246 snprintf(t, sizeof( t ), "%s/%s", bincue_path, s); | 244 snprintf(t, sizeof( t ), "%s/%s", bincue_path, s); |