diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-06-04 13:49:47 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-06-04 13:49:47 +0200 |
commit | 7e2ade27a742ea3f8b4989f47c8e147f4bd261ae (patch) | |
tree | aa54fd8dbafcfce98fb5d60143b7c662d6b7e7e8 /src/main.cpp | |
parent | 41176177c6bb8b9826643310e9652a2443732fd8 (diff) |
Make sure window id hex starts with 0x (makes monitor recording more reliable), allow CC and CXX to set compiler for build
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index f24a3f0..9515d8d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -732,20 +732,26 @@ static bool is_hex_num(char c) { } static bool contains_non_hex_number(const char *str) { + bool hex_start = false; size_t len = strlen(str); if(len >= 2 && memcmp(str, "0x", 2) == 0) { str += 2; len -= 2; + hex_start = true; } + bool is_hex = false; for(size_t i = 0; i < len; ++i) { char c = str[i]; if(c == '\0') return false; if(!is_hex_num(c)) return true; + if((c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')) + is_hex = true; } - return false; + + return is_hex && !hex_start; } static std::string get_date_str() { |