We already abort if initial call fails, so there is no reason to not to the same, even if we fully expect it wouldn't fail at this point.
Unified · Split
| @@ -114,6 +114,8 @@ wchar_t *mp_from_utf8(void *talloc_ctx, const char *s) · 113 unmodified lines | |||
| 114 | abort(); | 114 | abort(); |
| 115 | wchar_t *ret = talloc_array(talloc_ctx, wchar_t, count); | 115 | wchar_t *ret = talloc_array(talloc_ctx, wchar_t, count); |
| 116 | MultiByteToWideChar(CP_UTF8, 0, s, -1, ret, count); | 116 | MultiByteToWideChar(CP_UTF8, 0, s, -1, ret, count); |
| 117 | if (count <= 0) | ||
| 118 | abort(); | ||
| 117 | return ret; | 119 | return ret; |
| 118 | } | 120 | } |
| 119 | 121 | ||
| @@ -124,6 +126,8 @@ char *mp_to_utf8(void *talloc_ctx, const wchar_t *s) · 4 unmodified lines | |||
| 124 | abort(); | 126 | abort(); |
| 125 | char *ret = talloc_array(talloc_ctx, char, count); | 127 | char *ret = talloc_array(talloc_ctx, char, count); |
| 126 | WideCharToMultiByte(CP_UTF8, 0, s, -1, ret, count, NULL, NULL); | 128 | WideCharToMultiByte(CP_UTF8, 0, s, -1, ret, count, NULL, NULL); |
| 129 | if (count <= 0) | ||
| 130 | abort(); | ||
| 127 | return ret; | 131 | return ret; |
| 128 | } | 132 | } |
| 129 | 133 | ||