# HG changeset patch # User reimar # Date 1306671818 0 # Node ID 4ecf8f0b024c377dcbde4d94e9f4104ed4123f67 # Parent cdc8cec139adcf354371752a0e7f619ffd669bf5 Simplify by using av_strlcpy. diff -r cdc8cec139ad -r 4ecf8f0b024c stream/stream_cue.c --- a/stream/stream_cue.c Sun May 29 12:16:13 2011 +0000 +++ b/stream/stream_cue.c Sun May 29 12:23:38 2011 +0000 @@ -224,9 +224,8 @@ break; case 2: /* now I would say the whole filename is shit, build our own */ - strncpy(s, cue_filename, strlen(cue_filename) - 3 ); - s[strlen(cue_filename) - 3] = '\0'; - strcat(s, "bin"); + av_strlcpy(s, cue_filename, strlen(cue_filename) - 3 ); + strcat(s, ".bin"); cur_name = s; break; case 3: @@ -236,9 +235,8 @@ break; case 4: /* now I would say the whole filename is shit, build our own */ - strncpy(s, cue_filename, strlen(cue_filename) - 3 ); - s[strlen(cue_filename) - 3] = '\0'; - strcat(s, "img"); + av_strlcpy(s, cue_filename, strlen(cue_filename) - 3 ); + strcat(s, ".img"); cur_name = s; break; case 5: