winprefs v0.3.2
A registry exporter for programmers.
Loading...
Searching...
No Matches
utils.h
1#ifndef UTILS_H
2#define UTILS_H
3
4static inline size_t determine_multi_sz_size(wchar_t *w_data, size_t hint) {
5 if (hint == 0) {
6 return 0;
7 }
8 size_t i;
9 // Validate the string has correct null terminators
10 for (i = 0; i < (hint - 1); i++) {
11 wchar_t a = w_data[i];
12 wchar_t b = w_data[i + 1];
13 if (a == L'\0' && b == L'\0') {
14 return i + 1;
15 }
16 }
17 return 0;
18}
19
20#endif // UTILS_H