libobs/util: Use is_padding() for wcsdepad as well

Fix wcsdepad so that it checks for padding in the same way strdepad
does.
This commit is contained in:
jp9000 2020-07-11 16:14:42 -07:00
parent 05826491af
commit 18b915a47b

View File

@ -197,7 +197,7 @@ wchar_t *wstrstri(const wchar_t *str, const wchar_t *find)
return NULL;
}
static inline bool is_padding(char ch)
static inline bool is_padding(int ch)
{
return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r';
}
@ -244,7 +244,7 @@ wchar_t *wcsdepad(wchar_t *str)
temp = str;
/* remove preceding spaces/tabs */
while (*temp == ' ' || *temp == '\t')
while (is_padding(*temp))
++temp;
len = wcslen(temp);
@ -253,7 +253,7 @@ wchar_t *wcsdepad(wchar_t *str)
if (len) {
temp = str + (len - 1);
while (*temp == ' ' || *temp == '\t')
while (is_padding(*temp))
*(temp--) = 0;
}