From 7b9e1fb43145d70ea0216abc974d936b596ac3ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Sun, 28 Jun 2015 22:31:31 +0100 Subject: [PATCH] Safer initialization --- Sparkle/SUGuidedPackageInstaller.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sparkle/SUGuidedPackageInstaller.m b/Sparkle/SUGuidedPackageInstaller.m index 7537e30a..3c6481ff 100644 --- a/Sparkle/SUGuidedPackageInstaller.m +++ b/Sparkle/SUGuidedPackageInstaller.m @@ -55,11 +55,11 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza const char* executableFileSystemRepresentation = [executablePath fileSystemRepresentation]; // Prepare a right allowing script to execute with privileges - AuthorizationItem right; - memset(&right,0,sizeof(right)); - right.name = kAuthorizationRightExecute; - right.value = (void*) executableFileSystemRepresentation; - right.valueLength = strlen(executableFileSystemRepresentation); + AuthorizationItem right = { + .name = kAuthorizationRightExecute, + .value = (char*)executableFileSystemRepresentation, + .valueLength = strlen(executableFileSystemRepresentation), + }; // Package up the single right AuthorizationRights rights;