Browse Source

IOS-2794 Check last line outside the loop

IOS-2794
Dirk Zimmermann 1 year ago
parent
commit
224c0b961b
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      pantomime-lib/Framework/Pantomime/CWPart.m

+ 3
- 3
pantomime-lib/Framework/Pantomime/CWPart.m View File

@ -554,11 +554,11 @@ static int currentPartVersion = 2;
}
NSMutableArray *allLines = [dataToSend componentsSeparatedByCString: "\n"];
if ([[allLines lastObject] length] == 0) {
[allLines removeLastObject];
}
NSUInteger count = [allLines count];
for (int i = 0; i < count; i++) {
if (i == count - 1 && [[allLines objectAtIndex: i] length] == 0) {
break;
}
[dataValue appendData: [allLines objectAtIndex: i]];
[dataValue appendBytes: LF length: 1];
}


Loading…
Cancel
Save