[vlc-commits] commit: sn?printf -> strl?cpy ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Thu Jun 17 03:48:55 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jun 17 04:50:39 2010 +0300| [07329b0a5a64b6fd3d9c7c078fc08f3148be81ba] | committer: Rémi Denis-Courmont 

sn?printf -> strl?cpy

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=07329b0a5a64b6fd3d9c7c078fc08f3148be81ba
---

 modules/gui/ncurses.c        |    2 +-
 modules/misc/notify/notify.c |    2 +-
 src/text/strings.c           |   36 +++++++++---------------------------
 3 files changed, 11 insertions(+), 29 deletions(-)

diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index 2c58fab..def55d5 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -1472,7 +1472,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
     memset( psz_title, ' ', mid );
     if( p_sys->b_color )
         wcolor_set( p_sys->w, C_TITLE, NULL );
-    snprintf( &psz_title[mid], i_size, "VLC media player "PACKAGE_VERSION );
+    strlcpy( &psz_title[mid], "VLC media player "PACKAGE_VERSION, i_size );
     mvnprintw( y, 0, COLS, "%s", psz_title );
     attroff( A_REVERSE );
     y += 2;
diff --git a/modules/misc/notify/notify.c b/modules/misc/notify/notify.c
index c3862b0..9069e6d 100644
--- a/modules/misc/notify/notify.c
+++ b/modules/misc/notify/notify.c
@@ -251,7 +251,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
         }
         else
         {
-            snprintf( &psz_notify[i_notify], 6, "&amp;" );
+            strcpy( &psz_notify[i_notify], "&amp;" );
             i_notify += 4;
         }
         i_notify++;
diff --git a/src/text/strings.c b/src/text/strings.c
index ee05699..1d87eb8 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -700,9 +700,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
                         vlc_mutex_unlock( &p_item->p_stats->lock );
                     }
                     else
-                    {
-                        sprintf( buf, b_empty_if_na ? "" : "-" );
-                    }
+                        strcpy( buf, b_empty_if_na ? "" : "-" );
                     INSERT_STRING_NO_FREE( buf );
                     break;
                 case 'g':
@@ -770,9 +768,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
                                   var_GetInteger( p_input, "bit-rate" )/1000 );
                     }
                     else
-                    {
-                        sprintf( buf, b_empty_if_na ? "" : "-" );
-                    }
+                        strcpy( buf, b_empty_if_na ? "" : "-" );
                     INSERT_STRING_NO_FREE( buf );
                     break;
                 case 'C':
@@ -782,9 +778,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
                                   var_GetInteger( p_input, "chapter" ) );
                     }
                     else
-                    {
-                        sprintf( buf, b_empty_if_na ? "" : "-" );
-                    }
+                        strcpy( buf, b_empty_if_na ? "" : "-" );
                     INSERT_STRING_NO_FREE( buf );
                     break;
                 case 'D':
@@ -794,9 +788,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
                         format_duration (buf, sizeof (buf), i_duration);
                     }
                     else
-                    {
-                        snprintf( buf, 10, b_empty_if_na ? "" : "--:--:--" );
-                    }
+                        strcpy( buf, b_empty_if_na ? "" : "--:--:--" );
                     INSERT_STRING_NO_FREE( buf );
                     break;
                 case 'F':
@@ -812,9 +804,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
                                   var_GetInteger( p_input, "title" ) );
                     }
                     else
-                    {
-                        sprintf( buf, b_empty_if_na ? "" : "-" );
-                    }
+                        strcpy( buf, b_empty_if_na ? "" : "-" );
                     INSERT_STRING_NO_FREE( buf );
                     break;
                 case 'L':
@@ -826,9 +816,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
                                          i_duration - i_time );
                     }
                     else
-                    {
-                        snprintf( buf, 10, b_empty_if_na ? "" : "--:--:--" );
-                    }
+                        strcpy( buf, b_empty_if_na ? "" : "--:--:--" );
                     INSERT_STRING_NO_FREE( buf );
                     break;
                 case 'N':
@@ -867,9 +855,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
                         snprintf( buf, 10, "%.3f", f );
                     }
                     else
-                    {
-                        sprintf( buf, b_empty_if_na ? "" : "-" );
-                    }
+                        strcpy( buf, b_empty_if_na ? "" : "-" );
                     INSERT_STRING_NO_FREE( buf );
                     break;
                 case 'S':
@@ -879,9 +865,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
                         snprintf( buf, 10, "%d.%d", r/1000, (r/100)%10 );
                     }
                     else
-                    {
-                        sprintf( buf, b_empty_if_na ? "" : "-" );
-                    }
+                        strcpy( buf, b_empty_if_na ? "" : "-" );
                     INSERT_STRING_NO_FREE( buf );
                     break;
                 case 'T':
@@ -891,9 +875,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
                         format_duration( buf, sizeof(buf), i_time );
                     }
                     else
-                    {
-                        snprintf( buf, 10, b_empty_if_na ? "" :  "--:--:--" );
-                    }
+                        strcpy( buf, b_empty_if_na ? "" :  "--:--:--" );
                     INSERT_STRING_NO_FREE( buf );
                     break;
                 case 'U':



More information about the vlc-commits mailing list