diff options
Diffstat (limited to 'include/al')
| -rw-r--r-- | include/al/wstr.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/al/wstr.h b/include/al/wstr.h index e5610a2..964d3d9 100644 --- a/include/al/wstr.h +++ b/include/al/wstr.h @@ -69,7 +69,7 @@ static inline void al_wstr_sized(wstr *w, u32 size) static inline void al_wstr_clone(wstr *dest, wstr *src) { - u32 length = src->length; + size_t length = (size_t)src->length; al_wstr_sized(dest, length + 1); al_memcpy(dest->data, src->data, length * sizeof(wchar_t)); dest->data[length] = L'\0'; @@ -80,8 +80,7 @@ static inline bool al_wstr_from_cstr(wstr *w, char *c) { #ifdef AL_HAVE_WIDE_STRING mbstate_t mbstate = { 0 }; - size_t length; - length = mbsrtowcs(NULL, (const char **)&c, 0, &mbstate); + size_t length = mbsrtowcs(NULL, (const char **)&c, 0, &mbstate); if (length == (size_t)-1) { return false; } @@ -110,7 +109,7 @@ static inline bool al_str_from_wstr(str *s, wstr *w) // This is broken on Windows. Locale issue? #ifdef AL_HAVE_WIDE_STRING wstr copy; - // We have to make a copy here incase w->length is less than the + // We have to make a copy in case w->length is less than the // full string pointed to by w->data. al_wstr_clone(©, w); wchar_t *copy_data = copy.data; |