[vlc-commits] macosx: fixed objc string comparison error found by the clang static analyzer

Felix Paul Kühne git at videolan.org
Thu Nov 15 20:52:34 CET 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Nov 15 20:52:34 2012 +0100| [79d88eedc9e94decec97a0e034887abee8b8a29b] | committer: Felix Paul Kühne

macosx: fixed objc string comparison error found by the clang static analyzer

this worked out of pure luck for the past 6 years

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

 modules/gui/macosx/wizard.m |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/wizard.m b/modules/gui/macosx/wizard.m
index bc7bafd..1688e20 100644
--- a/modules/gui/macosx/wizard.m
+++ b/modules/gui/macosx/wizard.m
@@ -1097,7 +1097,7 @@ static VLCWizard *_o_sharedInstance = nil;
             NSString * theEncapFormat = [[o_encapFormats objectAtIndex:
                 [[o_userSelections objectForKey:@"encapFormat"] intValue]]
                 objectAtIndex:0];
-            if (theEncapFormat == @"ps")
+            if ([theEncapFormat isEqualToString:@"ps"])
                 theEncapFormat = @"mpg";
 
             /* look whether we need to process multiple items or not.
@@ -1483,7 +1483,7 @@ static VLCWizard *_o_sharedInstance = nil;
                     [o_sap_option appendFormat: @"sap,name=\"%@\"",
                         [o_userSelections objectForKey:@"sapText"]];
                 }
-                if ([[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0] == @"rtp")
+                if ([[[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0] isEqualToString:@"rtp"])
                 {
                     /* RTP is no access out, but a stream out module */
                     [o_opts_string appendFormat:
@@ -1507,7 +1507,7 @@ static VLCWizard *_o_sharedInstance = nil;
             else
             {
                 /* no SAP, just streaming */
-                if ([[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0] == @"rtp")
+                if ([[[o_strmgMthds objectAtIndex: [[o_userSelections objectForKey: @"stmgMhd"] intValue]] objectAtIndex:0] isEqualToString:@"rtp"])
                 {
                     /* RTP is different from the other protocols, as it isn't provided through an access out module anymore */
                     [o_opts_string appendFormat:
@@ -1858,7 +1858,7 @@ static VLCWizard *_o_sharedInstance = nil;
         NSString * theEncapFormat = [[o_encapFormats objectAtIndex:
         [[o_userSelections objectForKey:@"encapFormat"] intValue]]
         objectAtIndex:0];
-        if (theEncapFormat != @"ps")
+        if (![theEncapFormat isEqualToString:@"ps"])
             [saveFilePanel setAllowedFileTypes: [NSArray arrayWithObject:theEncapFormat]];
         else
             [saveFilePanel setAllowedFileTypes: [NSArray arrayWithObject:@"mpg"]];



More information about the vlc-commits mailing list