[vlc-commits] macosx: fixed potential crashes when localizing strings

Felix Paul Kühne git at videolan.org
Sun Jan 29 23:49:25 CET 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Jan 29 23:44:29 2012 +0100| [bd8116f9e678f2fd2e80f5fc10826edcdb04d927] | committer: Jean-Baptiste Kempf

macosx: fixed potential crashes when localizing strings
(cherry picked from commit fb5766e398fa651791f5b7b7071a04ec175d9e5f)

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

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

 modules/gui/macosx/intf.h |    2 +-
 modules/gui/macosx/intf.m |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h
index e4be09f..f79efbf 100644
--- a/modules/gui/macosx/intf.h
+++ b/modules/gui/macosx/intf.h
@@ -48,7 +48,7 @@ unsigned int CocoaKeyToVLC( unichar i_key );
 
 #define VLCIntf [[VLCMain sharedInstance] intf]
 
-#define _NS(s) [[VLCMain sharedInstance] localizedString: _(s)]
+#define _NS(s) [[VLCMain sharedInstance] localizedString: s]
 /* Get an alternate version of the string.
  * This string is stored as '1:string' but when displayed it only displays
  * the translated string. the translation should be '1:translatedstring' though */
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 93bd22b..b9afbf1 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -1000,7 +1000,7 @@ static VLCMain *_o_sharedMainInstance = nil;
 
     if( psz != NULL )
     {
-        o_str = [NSString stringWithCString: psz encoding:NSUTF8StringEncoding];
+        o_str = [NSString stringWithCString: _(psz) encoding:NSUTF8StringEncoding];
 
         if( o_str == NULL )
         {



More information about the vlc-commits mailing list