From 037e7cc02b66a54d5dec19a6b93a7bf107a95a0e Mon Sep 17 00:00:00 2001
From: gcontini <1121667+gcontini@users.noreply.github.com>
Date: 周六, 28 3月 2020 22:29:12 +0800
Subject: [PATCH] documentation update (win32) and others

---
 src/library/locate/ExternalDefinition.cpp |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/library/locate/ExternalDefinition.cpp b/src/library/locate/ExternalDefinition.cpp
index 7413aeb..a5309de 100644
--- a/src/library/locate/ExternalDefinition.cpp
+++ b/src/library/locate/ExternalDefinition.cpp
@@ -9,19 +9,19 @@
 #include <cstring>
 #include <string>
 #include <vector>
-
+#include <stdexcept>
 #include <licensecc/datatypes.h>
 
 #include "../base/base64.h"
 #include "../base/EventRegistry.h"
-#include "../base/FileUtils.hpp"
 #include "../base/StringUtils.h"
 
 #include "ExternalDefinition.hpp"
+#include "../base/file_utils.hpp"
 
 namespace license {
 namespace locate {
-using namespace std;
+	using namespace std;
 
 ExternalDefinition::ExternalDefinition(const LicenseLocation *location)
 	: LocatorStrategy("ExternalDefinition"), m_location(location) {}
@@ -54,10 +54,9 @@
 	if (licenseLocation == get_strategy_name()) {
 		string licData(m_location->licenseData, mstrnlen_s(m_location->licenseData, LCC_API_MAX_LICENSE_DATA_LENGTH));
 		if (m_location->license_data_type == LICENSE_ENCODED) {
-			int flen = 0;
-			unsigned char *raw = unbase64(licData.c_str(), licData.length(), &flen);
-			string str = string(reinterpret_cast<char *>(raw));
-			free(raw);
+			// FIXME what if license is wrong
+			vector<uint8_t> raw = unbase64(licData);
+			string str = string(reinterpret_cast<char *>(raw.data()));
 			return str;
 		} else {
 			return licData;

--
Gitblit v1.9.1