]> git.sesse.net Git - vlc/commitdiff
macosx: fixed objc string comparison error found by the clang static analyzer
authorFelix Paul Kühne <fkuehne@videolan.org>
Thu, 15 Nov 2012 19:52:34 +0000 (20:52 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Thu, 15 Nov 2012 19:52:34 +0000 (20:52 +0100)
this worked out of pure luck for the past 6 years

modules/gui/macosx/wizard.m

index bc7bafd26bf7d7fbd308470769c0b7c642fe2517..1688e20400bdbb71f1f303e4b0fe318446a04269 100644 (file)
@@ -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"]];