Safer initialization

This commit is contained in:
Kornel Lesiński committed 2015-06-28 22:50:50 +01:00
1 parent 9f23c4f11e
commit 7b9e1fb431
1 file changed
+5 -5
+5 -5
View File
@@ -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;