1 parent b59b2d9 commit 3a853a4Copy full SHA for 3a853a4
1 file changed
hmac.mqh
@@ -54,6 +54,9 @@ namespace hmac {
54
string to_hex(const string& str, bool is_upper = false) {
55
uchar bytes[];
56
StringToCharArray(str, bytes, 0, -1, CP_UTF8);
57
+ int len = ArraySize(bytes);
58
+ if (len > 0 && bytes[len - 1] == '\0') len -= 1;
59
+ ArrayResize(bytes, len);
60
return to_hex(bytes, is_upper);
61
}
62
0 commit comments