[vlc-commits] commit: module_gettext: return "" on NULL, fixes a segmentation fault ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Thu Aug 19 22:52:26 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Aug 19 23:51:52 2010 +0300| [bf151581da3e1aeac58e72bae317f080599fa2a7] | committer: Rémi Denis-Courmont 

module_gettext: return "" on NULL, fixes a segmentation fault

There still are some formatting issues (e.g. --cdda-track)

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

 src/modules/modules.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/modules/modules.c b/src/modules/modules.c
index 62d9ddd..c5e2c4f 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -301,7 +301,7 @@ const char *module_gettext (const module_t *m, const char *str)
 {
 #ifdef ENABLE_NLS
     const char *domain = m->domain ? m->domain : PACKAGE_NAME;
-    if (unlikely(!*str))
+    if (unlikely(str == NULL || *str == '\0'))
         return "";
     return dgettext (domain, str);
 #else



More information about the vlc-commits mailing list