Commit bf151581 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

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

There still are some formatting issues (e.g. --cdda-track)
parent e756f132
...@@ -301,7 +301,7 @@ const char *module_gettext (const module_t *m, const char *str) ...@@ -301,7 +301,7 @@ const char *module_gettext (const module_t *m, const char *str)
{ {
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
const char *domain = m->domain ? m->domain : PACKAGE_NAME; const char *domain = m->domain ? m->domain : PACKAGE_NAME;
if (unlikely(!*str)) if (unlikely(str == NULL || *str == '\0'))
return ""; return "";
return dgettext (domain, str); return dgettext (domain, str);
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment