Browse Source

Fix off-by-one

(cherry picked from commit 06c43ffea8214f4412f50a5a57dee91964ae8b67)
Felix Paul Kühne 9 years ago
parent
commit
e247ead548

+ 2 - 2
Sources/LocalNetworkConnectivity/VLCNetworkServerBrowserViewController.m

@@ -126,9 +126,9 @@
 - (void)playAllAction:(id)sender
 {
     VLCMediaList *fullMediaList = self.serverBrowser.mediaList;
-    NSUInteger count = fullMediaList.count;
+    NSInteger count = fullMediaList.count;
     NSMutableArray *fileList = [[NSMutableArray alloc] init];
-    for (NSUInteger x = count - 1; x > 0; x--) {
+    for (NSInteger x = count - 1; x > -1; x--) {
         VLCMedia *media = [fullMediaList mediaAtIndex:x];
         VLCMediaType mediaType = media.mediaType;
         if (mediaType == VLCMediaTypeFile || mediaType == VLCMediaTypeStream || mediaType == VLCMediaTypeUnknown) {