summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorjvoisin2025-10-31 21:08:47 +0100
committerjvoisin2025-11-10 23:55:25 +0100
commitbc2641769ec3019ab7d794b032a6e36030581c76 (patch)
tree6d546b4dd0f9ab73ddc82563c9e70a65f51783d3 /include
parent4a26785c0cab4686e5825fe5f5e921d12e7142b7 (diff)
Remove wctomb
It's unfortunately valid to pass a buffer smaller than MB_CUR_MAX to wctomb, so let's not trap on this. Moreover, it's supposed to be implemented in stdlib.h and not wchar.h anyway.
Diffstat (limited to 'include')
-rw-r--r--include/wchar.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/include/wchar.h b/include/wchar.h
index d031397..a840f1a 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -51,7 +51,6 @@ extern "C" {
51#undef wcsncpy 51#undef wcsncpy
52#undef wcsrtombs 52#undef wcsrtombs
53#undef wcstombs 53#undef wcstombs
54#undef wctomb
55#undef wmemcpy 54#undef wmemcpy
56#undef wmemmove 55#undef wmemmove
57#undef wmemset 56#undef wmemset
@@ -228,15 +227,6 @@ _FORTIFY_FN(wcstombs) size_t wcstombs(char * _FORTIFY_POS0 __s,
228 return __orig_wcstombs(__s, __ws, __n); 227 return __orig_wcstombs(__s, __ws, __n);
229} 228}
230 229
231_FORTIFY_FN(wctomb) int wctomb(char * _FORTIFY_POS0 __s, wchar_t __w)
232{
233 size_t __b = __bos(__s, 0);
234
235 if (__s && MB_LEN_MAX > __b && MB_CUR_MAX > __b)
236 __builtin_trap();
237 return __orig_wctomb(__s, __w);
238}
239
240_FORTIFY_FN(wmemcpy) wchar_t *wmemcpy(wchar_t * _FORTIFY_POS0 __d, 230_FORTIFY_FN(wmemcpy) wchar_t *wmemcpy(wchar_t * _FORTIFY_POS0 __d,
241 const wchar_t *__s, size_t __n) 231 const wchar_t *__s, size_t __n)
242{ 232{