Compatibility with Source engine
2 unresolved threads
2 unresolved threads
The changes in this MR are necessary for Source-based games to run through gcompat.
- There are a few changes to formatting, seemingly because source wasn't formatted by the previous contributor.
- Current implementation of __strncat_chk would cause assertion error in Source.
- __wcscat_chk and __wcsncpy_chk couldn't be found by dynamic linker.
Merge request reports
Activity
mentioned in issue #363
247 247 248 248 assert(dest != NULL); 249 249 assert(src != NULL); 250 total = strnlen(dest, destlen) + n + 1; 250 total = strnlen(dest, destlen) + strnlen(src, destlen) + 1; 140 size_t __mbrlen(const char *restrict s, size_t n, mbstate_t *restrict st) { 141 return mbrlen(s, n, st); 149 assert(destlen >= n); 150 151 return wcsncpy(dest, src, n); 152 } 153 154 wchar_t *__wcscat_chk(wchar_t *dest, const wchar_t *src, size_t n) 155 { 156 wchar_t *a = dest; 157 size_t destlen = wcslen(dest); 158 assert(destlen + wcslen(src) + 1 <= n); 159 160 dest += destlen; 161 while (n && *src) { 162 n--; added 6 commits
-
b0c5bb96...73b40546 - 4 commits from branch
adelie:current
- 785d71e5 - string: change behavior of __strncat_chk
- 7f2d3d5a - wchar: add __wcscat_chk, __wcsncpy_chk
-
b0c5bb96...73b40546 - 4 commits from branch
Please register or sign in to reply