[vlc-commits] dsm: don't use netbios struct members directly

Thomas Guillem git at videolan.org
Wed Dec 10 18:26:09 CET 2014


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Dec 10 18:19:47 2014 +0100| [fadec97356fe30465ce1883e72b3b6ee7bf22572] | committer: Jean-Baptiste Kempf

dsm: don't use netbios struct members directly

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/access/dsm/sd.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/access/dsm/sd.c b/modules/access/dsm/sd.c
index 9b581f6..724a77e 100644
--- a/modules/access/dsm/sd.c
+++ b/modules/access/dsm/sd.c
@@ -67,16 +67,18 @@ int bdsm_SdOpen (vlc_object_t *p_this)
     for( ssize_t i = 0; i < netbios_ns_entry_count( p_sys->ns ); i++ )
     {
         netbios_ns_entry *p_entry = netbios_ns_entry_at( p_sys->ns, i );
+        char type = netbios_ns_entry_type( p_entry );
 
-        if( p_entry->type == 0x20 )
+        if( type == 0x20 )
         {
             input_item_t *p_item;
             char *psz_mrl;
+            const char *name = netbios_ns_entry_name( p_entry );
 
-            if( asprintf(&psz_mrl, "smb://%s", p_entry->name) < 0 )
+            if( asprintf(&psz_mrl, "smb://%s", name) < 0 )
                 goto error;
 
-            p_item = input_item_NewWithType( psz_mrl, p_entry->name, 0, NULL,
+            p_item = input_item_NewWithType( psz_mrl, name, 0, NULL,
                                              0, -1, ITEM_TYPE_NODE );
             msg_Dbg( p_sd, "Adding item %s", psz_mrl );
 



More information about the vlc-commits mailing list