[vlc-devel] commit: services_discovery: fix embedding translated longname into name ( Jakob Leben )

Laurent Aimar fenrir at via.ecp.fr
Tue Feb 9 19:12:37 CET 2010


Hi,

On Tue, Feb 09, 2010, git version control wrote:
> vlc | branch: master | Jakob Leben <jleben at videolan.org> | Tue Feb  9 19:00:45 2010 +0100| [caa08dce07c3b08677645263e325b33148f536bd] | committer: Jakob Leben 
> 
> services_discovery: fix embedding translated longname into name
> 
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=caa08dce07c3b08677645263e325b33148f536bd
> ---
> 
>  include/vlc_services_discovery.h |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/include/vlc_services_discovery.h b/include/vlc_services_discovery.h
> index 06026c7..0efed92 100644
> --- a/include/vlc_services_discovery.h
> +++ b/include/vlc_services_discovery.h
> @@ -101,8 +101,11 @@ VLC_EXPORT(int, vlc_sd_probe_Add, (vlc_probe_t *, const char *, const char *));
>  #define VLC_SD_PROBE_HELPER(name, longname) \
>  static int vlc_sd_probe_Open (vlc_object_t *obj) \
>  { \
> +    char *psz_longname = longname; \
> +    char psz_name[ strlen( psz_longname ) + 20 ]; \
> +    sprintf( psz_name, name "{longname=\"%s\"}", psz_longname ); \
config_StringEscape() will properly escape a string to be used with config_chain_t.
Something like:
 char *p = config_StringEscape(longname);
 asprintf(&psz_name, "%s{longname=%s}", name, p);
 free(p);
Dunno if it is really needed here.

-- 
fenrir



More information about the vlc-devel mailing list