- char *ptr = strchr(hex_bpfen, '\n');
- if (ptr != NULL) {
- *ptr = 0;
- }
-
- const int bpfen_len = strlen(hex_bpfen) / 2;
- uint8_t *bpfen = new uint8_t[bpfen_len];
-
- for (int i = 0; i < bpfen_len; ++i) {
- char x[3];
- x[0] = hex_bpfen[i * 2 + 0];
- x[1] = hex_bpfen[i * 2 + 1];
- x[2] = 0;
- int k;
- sscanf(x, "%02x", &k);
- bpfen[i] = k;
- }