[MPlayer-cvslog] r33520 - trunk/stream/stream_cue.c

reimar subversion at mplayerhq.hu
Sun May 29 14:23:39 CEST 2011


Author: reimar
Date: Sun May 29 14:23:38 2011
New Revision: 33520

Log:
Simplify by using av_strlcpy.

Modified:
   trunk/stream/stream_cue.c

Modified: trunk/stream/stream_cue.c
==============================================================================
--- trunk/stream/stream_cue.c	Sun May 29 14:16:13 2011	(r33519)
+++ trunk/stream/stream_cue.c	Sun May 29 14:23:38 2011	(r33520)
@@ -224,9 +224,8 @@ static int cue_find_bin (const char *fir
       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 @@ static int cue_find_bin (const char *fir
       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:


More information about the MPlayer-cvslog mailing list