[vlc-commits] FromLocaleDup(): accept NULL input (and return NULL)

Rafaël Carré git at videolan.org
Tue Aug 30 05:31:06 CEST 2011


vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Mon Aug 29 22:07:25 2011 -0400| [3ab2f937b7f2dbd77e4cd161ef926ecb07dc147b] | committer: Rafaël Carré

FromLocaleDup(): accept NULL input (and return NULL)

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

 src/text/unicode.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/text/unicode.c b/src/text/unicode.c
index 50ffdb2..342037b 100644
--- a/src/text/unicode.c
+++ b/src/text/unicode.c
@@ -90,6 +90,9 @@ char *FromLocale (const char *locale)
  */
 char *FromLocaleDup (const char *locale)
 {
+    if (!locale)
+        return NULL;
+
 #ifdef ASSUME_UTF8
     return strdup (locale);
 #else



More information about the vlc-commits mailing list