-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: drop simdjson dependency #23
Conversation
@@ -261,8 +260,8 @@ | |||
return DDNS_ERROR_GENERIC; | |||
} | |||
|
|||
std::memcpy(zone_id, zone_id_sv.data(), zone_id_sv.length()); | |||
zone_id[zone_id_sv.length()] = '\0'; | |||
std::memcpy(zone_id, zone_id_sv->data(), zone_id_sv->length()); |
Check notice
Code scanning / Flawfinder (reported by Codacy)
Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. Note
|
||
std::memcpy(record_id, record_id_sv.data(), record_id_sv.length()); | ||
record_id[record_id_sv.length()] = '\0'; | ||
std::memcpy(record_id, record_id_sv->data(), record_id_sv->length()); |
Check notice
Code scanning / Flawfinder (reported by Codacy)
Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. Note
return DDNS_ERROR_USAGE; | ||
} | ||
|
||
std::memcpy(record_ip, record_ip_sv.data(), record_ip_sv.length()); | ||
record_ip[record_ip_sv.length()] = '\0'; | ||
std::memcpy(record_ip, record_ip_sv->data(), record_ip_sv->length()); |
Check notice
Code scanning / Flawfinder (reported by Codacy)
Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. Note
return DDNS_ERROR_USAGE; | ||
} | ||
|
||
std::memcpy(record_ip, record_ip_sv.data(), record_ip_sv.length()); | ||
record_ip[record_ip_sv.length()] = '\0'; | ||
std::memcpy(record_ip, record_ip_sv->data(), record_ip_sv->length()); |
Check notice
Code scanning / Flawfinder (reported by Codacy)
Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. Note
@@ -23,10 +23,9 @@ | |||
#endif | |||
|
|||
#include <cstring> /* std::memcpy, std::size_t, std::strlen */ | |||
#include <optional> /* std::optional */ |
Check warning
Code scanning / Cppcheck (reported by Codacy)
Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. Warning
@@ -18,21 +18,14 @@ | |||
#include <cstring> /* std::memchr, std::memcpy */ | |||
#include <filesystem> /* std::filesystem::path::preferred_separator */ | |||
#include <fstream> /* std::ifstream, std::ofstream */ | |||
#include <optional> /* std::optional */ |
Check warning
Code scanning / Cppcheck (reported by Codacy)
Include file: not found. Please note: Cppcheck does not need standard library headers to get proper results. Warning
@@ -31,7 +31,7 @@ | |||
|
|||
## Build | |||
|
|||
libcloudflare-ddns relies on [libcurl](https://curl.se) and [simdjson](https://simdjson.org), while the executable also depends on [inih](https://github.com/benhoyt/inih). | |||
libcloudflare-ddns relies on [libcurl](https://curl.se) only, while the executable also depends on [inih](https://github.com/benhoyt/inih). |
Check warning
Code scanning / Markdownlint (reported by Codacy)
Expected: 80; Actual: 139 Warning
cloudflare-ddns now doesn't depend anymore on simdjson, and JSON "parsing" is done manually with a really simple function which just looks at a JSON string and extracts a string value given a key, which is sufficient for cloudflare-ddns' needs. Dropping the simdjson dependency makes the project way easier and faster to compile, likely less resource intensive since no fancy SIMD instructions are executed, and more portable.
cloudflare-ddns now doesn't depend anymore on simdjson, and JSON "parsing" is done manually with a really simple function which just looks at a JSON string and extracts a string value given a key, which is sufficient for cloudflare-ddns' needs.
Dropping the simdjson dependency makes the project way easier and faster to compile, likely less resource intensive since no fancy SIMD instructions are executed, and more portable.