pidgin/pidgin

Remove `purple_utf16*` functions.

2021-01-30, Elliott Sales de Andrade
265694d7b23d
Parents 5df699e43f3f
Children c9c950ce44bc
Remove `purple_utf16*` functions.

Testing Done:
Compiled only.

Reviewed at https://reviews.imfreedom.org/r/468/
--- a/libpurple/plugins/keyrings/wincred.c Sat Jan 30 04:38:54 2021 -0600
+++ b/libpurple/plugins/keyrings/wincred.c Sat Jan 30 05:39:19 2021 -0600
@@ -203,7 +203,7 @@
memset(&credential, 0, sizeof(CREDENTIALW));
credential.Type = CRED_TYPE_GENERIC;
credential.TargetName = target_name;
- credential.CredentialBlobSize = purple_utf16_size(password_utf16) - 2;
+ credential.CredentialBlobSize = password_len * sizeof(gunichar2);
credential.CredentialBlob = (LPBYTE)password_utf16;
credential.Persist = CRED_PERSIST_LOCAL_MACHINE;
credential.UserName = username_utf16;
--- a/libpurple/util.c Sat Jan 30 04:38:54 2021 -0600
+++ b/libpurple/util.c Sat Jan 30 05:39:19 2021 -0600
@@ -1167,23 +1167,6 @@
return ret;
}
-size_t
-purple_utf16_size(const gunichar2 *str)
-{
- /* UTF16 cannot contain two consequent NUL bytes starting at even
- * position - see Unicode standards Chapter 3.9 D91 or RFC2781
- * Chapter 2.
- */
-
- size_t i = 0;
-
- g_return_val_if_fail(str != NULL, 0);
-
- while (str[i++]);
-
- return i * sizeof(gunichar2);
-}
-
void
purple_str_wipe(gchar *str)
{
@@ -1193,15 +1176,6 @@
g_free(str);
}
-void
-purple_utf16_wipe(gunichar2 *str)
-{
- if (str == NULL)
- return;
- memset(str, 0, purple_utf16_size(str));
- g_free(str);
-}
-
/**************************************************************************
* URI/URL Functions
**************************************************************************/
--- a/libpurple/util.h Sat Jan 30 04:38:54 2021 -0600
+++ b/libpurple/util.h Sat Jan 30 05:39:19 2021 -0600
@@ -734,16 +734,6 @@
char *purple_str_seconds_to_string(guint sec);
/**
- * purple_utf16_size:
- * @str: String to check.
- *
- * Calculates UTF-16 string size (in bytes).
- *
- * Returns: Number of bytes (including NUL character) that string occupies.
- */
-size_t purple_utf16_size(const gunichar2 *str);
-
-/**
* purple_str_wipe:
* @str: A NUL-terminated string to free, or a NULL-pointer.
*
@@ -753,16 +743,6 @@
*/
void purple_str_wipe(gchar *str);
-/**
- * purple_utf16_wipe:
- * @str: A NUL-terminated string to free, or a NULL-pointer.
- *
- * Fills a NUL-terminated UTF-16 string with zeros and frees it.
- *
- * It should be used to free sensitive data, like passwords.
- */
-void purple_utf16_wipe(gunichar2 *str);
-
/**************************************************************************/
/* URI/URL Functions */
/**************************************************************************/