Skip to content

Commit

Permalink
Moving variables into while loop
Browse files Browse the repository at this point in the history
  • Loading branch information
colincornaby committed Feb 18, 2024
1 parent 87434f2 commit 3867d1c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Sources/Plasma/Apps/plClient/Mac-Cocoa/PLSPatcher.mm
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ bool IApproveDownload(const plFileName& file)

static la_ssize_t copy_data(struct archive *ar, struct archive *aw)
{
la_ssize_t r;
const void *buff;
size_t size;
la_int64_t offset;

while (true) {
la_ssize_t r;
const void *buff;
size_t size;
la_int64_t offset;

r = archive_read_data_block(ar, &buff, &size, &offset);
if (r == ARCHIVE_EOF)
return (ARCHIVE_OK);
Expand Down Expand Up @@ -252,8 +252,9 @@ static la_ssize_t copy_data(struct archive *ar, struct archive *aw)

NSError *error;
NSURL *tempDirectory = [NSFileManager.defaultManager URLForDirectory:NSItemReplacementDirectory inDomain:NSUserDomainMask appropriateForURL:[NSURL fileURLWithPath:NSFileManager.defaultManager.currentDirectoryPath] create:YES error:&error];
NSURL *outputURL;
if (tempDirectory) {
NSURL *outputURL = [tempDirectory URLByAppendingPathComponent:[NSString stringWithSTString:plManifest::PatcherExecutable().GetFileName()]];
outputURL = [tempDirectory URLByAppendingPathComponent:[NSString stringWithSTString:plManifest::PatcherExecutable().GetFileName()]];
[NSFileManager.defaultManager createDirectoryAtURL:outputURL withIntermediateDirectories:false attributes:nil error:&error];
}

Expand Down

0 comments on commit 3867d1c

Please sign in to comment.