Remove mbstowcs/wcstombs from g_strtrim()

Because of the way UTF-8 encoding works, there is no need to
use mbstowcs/wcstombs in the implementation of this function.
This commit is contained in:
matt335672
2023-09-20 15:04:41 +01:00
parent 0758fe03a6
commit 36ea4a3f86
2 changed files with 33 additions and 110 deletions
+7
View File
@@ -312,6 +312,13 @@ int g_pos(const char *str, const char *to_find);
char *g_strstr(const char *haystack, const char *needle);
int g_mbstowcs(twchar *dest, const char *src, int n);
int g_wcstombs(char *dest, const twchar *src, int n);
/** trim spaces and tabs, anything <= space
*
* @param str (assumed to be UTF-8)
* @param trim_flags 1 trim left, 2 trim right, 3 trim both, 4 trim through
* @return != 0 - trim_flags not recognised
* this will always shorten the string or not change it */
int g_strtrim(char *str, int trim_flags);
/**