From 8183cf8ec56b5238870e521c1be1b9a8b24925da Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 13 Aug 2024 00:13:22 +0800 Subject: [PATCH] update for macosx --- hikyuu/utilities/http_client/url.cpp | 2 +- hikyuu/utilities/mo/moFileReader.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hikyuu/utilities/http_client/url.cpp b/hikyuu/utilities/http_client/url.cpp index f582158..26d79d1 100644 --- a/hikyuu/utilities/http_client/url.cpp +++ b/hikyuu/utilities/http_client/url.cpp @@ -34,7 +34,7 @@ std::string url_escape(const char* istr) { if (is_unambiguous(*p)) { ostr += *p; } else { - sprintf(szHex, "%%%02X", *p); + snprintf(szHex, 4, "%%%02X", *p); ostr += szHex; } ++p; diff --git a/hikyuu/utilities/mo/moFileReader.h b/hikyuu/utilities/mo/moFileReader.h index 862d8d4..b40be05 100644 --- a/hikyuu/utilities/mo/moFileReader.h +++ b/hikyuu/utilities/mo/moFileReader.h @@ -588,7 +588,7 @@ class moFileReader { // Beautify Output std::string fname; - unsigned int pos = infile.find_last_of(MO_PATHSEP); + size_t pos = infile.find_last_of(MO_PATHSEP); if (pos != std::string::npos) { fname = infile.substr(pos + 1, infile.length()); } else {