[vlc-devel] commit: No need for sprintf() here ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Feb 10 17:59:59 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 10 17:38:33 2010 +0200| [ee73bdeaf577cdacb229ee298984aaf6fb23652a] | committer: Rémi Denis-Courmont 

No need for sprintf() here

This reverts commit af688c8f29ba84096f2e8f752bb5c0e8b4889b7a.

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

 include/vlc_services_discovery.h     |    5 ++---
 modules/services_discovery/bonjour.c |    2 +-
 modules/services_discovery/mtp.c     |    2 +-
 modules/services_discovery/podcast.c |    2 +-
 modules/services_discovery/sap.c     |    2 +-
 5 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/include/vlc_services_discovery.h b/include/vlc_services_discovery.h
index 9911f6a..956b77b 100644
--- a/include/vlc_services_discovery.h
+++ b/include/vlc_services_discovery.h
@@ -109,10 +109,9 @@ VLC_EXPORT(int, vlc_sd_probe_Add, (vlc_probe_t *, const char *, const char *, in
 #define VLC_SD_PROBE_HELPER(name, longname, cat) \
 static int vlc_sd_probe_Open (vlc_object_t *obj) \
 { \
-    char psz_name[ strlen( name ) + strlen( longname ) + 20 ]; \
-    sprintf( psz_name, "%s{longname=\"%s\"}", name, longname ); \
     return vlc_sd_probe_Add ((struct vlc_probe_t *)obj, \
-                             psz_name, longname, cat); \
+                             name "{longname=\"" longname "\"}", \
+                             longname, cat); \
 }
 
 /** @} */
diff --git a/modules/services_discovery/bonjour.c b/modules/services_discovery/bonjour.c
index dadb88b..0110e01 100644
--- a/modules/services_discovery/bonjour.c
+++ b/modules/services_discovery/bonjour.c
@@ -48,7 +48,7 @@
     static int  Open ( vlc_object_t * );
     static void Close( vlc_object_t * );
 
-VLC_SD_PROBE_HELPER("bonjour", N_("Bonjour services"), SD_CAT_LAN)
+VLC_SD_PROBE_HELPER("bonjour", "Bonjour services", SD_CAT_LAN)
 
 vlc_module_begin ()
     set_shortname( "Bonjour" )
diff --git a/modules/services_discovery/mtp.c b/modules/services_discovery/mtp.c
index ddb8e0b..96df1d6 100644
--- a/modules/services_discovery/mtp.c
+++ b/modules/services_discovery/mtp.c
@@ -38,7 +38,7 @@
 static int Open( vlc_object_t * );
 static void Close( vlc_object_t * );
 
-VLC_SD_PROBE_HELPER("mtp", N_("MTP devices"), SD_CAT_DEVICES)
+VLC_SD_PROBE_HELPER("mtp", "MTP devices", SD_CAT_DEVICES)
 
 vlc_module_begin()
     set_shortname( "MTP" )
diff --git a/modules/services_discovery/podcast.c b/modules/services_discovery/podcast.c
index 0b91ea1..6c45841 100644
--- a/modules/services_discovery/podcast.c
+++ b/modules/services_discovery/podcast.c
@@ -53,7 +53,7 @@
 static int  Open ( vlc_object_t * );
 static void Close( vlc_object_t * );
 
-VLC_SD_PROBE_HELPER("podcast", N_("Podcasts"), SD_CAT_INTERNET)
+VLC_SD_PROBE_HELPER("podcast", "Podcasts", SD_CAT_INTERNET)
 
 #define URLS_TEXT N_("Podcast URLs list")
 #define URLS_LONGTEXT N_("Enter the list of podcasts to retrieve, " \
diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c
index 73fa697..52c3b83 100644
--- a/modules/services_discovery/sap.c
+++ b/modules/services_discovery/sap.c
@@ -114,7 +114,7 @@
     static int  OpenDemux ( vlc_object_t * );
     static void CloseDemux ( vlc_object_t * );
 
-VLC_SD_PROBE_HELPER("sap", N_("Network streams (SAP)"), SD_CAT_LAN)
+VLC_SD_PROBE_HELPER("sap", "Network streams (SAP)", SD_CAT_LAN)
 
 vlc_module_begin ()
     set_shortname( N_("SAP"))




More information about the vlc-devel mailing list