From 7bcce486505d3b564b08282257e6451f8061bdb6 Mon Sep 17 00:00:00 2001 From: Double Sine Date: Mon, 14 Feb 2022 18:03:59 +0800 Subject: [PATCH] add open mode argument Signed-off-by: Double Sine --- navicat-keygen/GenerateLicense.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/navicat-keygen/GenerateLicense.cpp b/navicat-keygen/GenerateLicense.cpp index 89db14c..466ea31 100644 --- a/navicat-keygen/GenerateLicense.cpp +++ b/navicat-keygen/GenerateLicense.cpp @@ -194,7 +194,7 @@ namespace nkg { response_code.resize((cipher.bits() + 7) / 8); response_code.resize(cipher.private_encrypt(u8_response_info.data(), u8_response_info.size(), response_code.data(), RSA_PKCS1_PADDING)); - resource_wrapper license_file{ resource_traits::unix_os::file_descriptor{}, open("license_file", O_WRONLY | O_CREAT) }; + resource_wrapper license_file{ resource_traits::unix_os::file_descriptor{}, open("license_file", O_WRONLY | O_CREAT | O_TRUNC, 0666) }; if (!license_file.is_valid()) { throw exceptions::unix_exception(NKG_CURRENT_SOURCE_FILE(), NKG_CURRENT_SOURCE_LINE(), errno, u8"open failed."); }