[vlc-devel] [PATCH] don't return a bogus if_nametoindex() value when it's not supported

Steve Lhomme robUx4 at videolabs.io
Tue Mar 3 09:43:51 CET 2015


if_nametoindex() returns 0 when there's an error. We don't set errno appropriately but it's okay.
---
 include/vlc_fixups.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index b949d24..66fe610 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -301,7 +301,7 @@ struct if_nameindex
     char    *if_name;
 };
 # ifndef HAVE_IF_NAMETOINDEX
-#  define if_nametoindex(name)   atoi(name)
+#  define if_nametoindex(name)   0
 # endif
 # define if_nameindex()         (errno = ENOBUFS, NULL)
 # define if_freenameindex(list) (void)0
-- 
2.2.2




More information about the vlc-devel mailing list