diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/wchar.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/wchar.h b/include/wchar.h index 08a817b..7394598 100644 --- a/include/wchar.h +++ b/include/wchar.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2015-2016 Dimitris Papastamos <sin@2f30.org> | 2 | * Copyright (C) 2015-2017 Dimitris Papastamos <sin@2f30.org> |
| 3 | * | 3 | * |
| 4 | * Permission to use, copy, modify, and/or distribute this software for any | 4 | * Permission to use, copy, modify, and/or distribute this software for any |
| 5 | * purpose with or without fee is hereby granted. | 5 | * purpose with or without fee is hereby granted. |
| @@ -109,6 +109,8 @@ _FORTIFY_FN(wcrtomb) size_t wcrtomb(char *__s, wchar_t __w, mbstate_t *__st) | |||
| 109 | 109 | ||
| 110 | if (__s) { | 110 | if (__s) { |
| 111 | __r = __orig_wcrtomb(__buf, __w, __st); | 111 | __r = __orig_wcrtomb(__buf, __w, __st); |
| 112 | if (__r == (size_t)-1) | ||
| 113 | return __r; | ||
| 112 | if (__r > __b) | 114 | if (__r > __b) |
| 113 | __builtin_trap(); | 115 | __builtin_trap(); |
| 114 | memcpy(__s, __buf, __r); | 116 | memcpy(__s, __buf, __r); |
