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:
parent
05826491af
commit
18b915a47b
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user