diff --git a/src/common.c b/src/common.c index c0076ff3..c52670d1 100644 --- a/src/common.c +++ b/src/common.c @@ -679,12 +679,12 @@ get_file_paths_recursive(const char* path, GSList** contents) } } -char* +gchar* get_random_string(int length) { GRand* prng; - char* rand; - char alphabet[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + gchar* rand; + gchar alphabet[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; int endrange = sizeof(alphabet) - 1; rand = g_malloc0(length + 1); diff --git a/src/common.h b/src/common.h index 6d4c0007..1f83c817 100644 --- a/src/common.h +++ b/src/common.h @@ -206,7 +206,7 @@ int is_regular_file(const char* path); int is_dir(const char* path); void get_file_paths_recursive(const char* directory, GSList** contents); -char* get_random_string(int length); +gchar* get_random_string(int length); gboolean call_external(gchar** argv); gchar** format_call_external_argv(const char* template, const char* url, const char* filename); diff --git a/src/tools/aesgcm_download.h b/src/tools/aesgcm_download.h index 796b9389..37e15ff0 100644 --- a/src/tools/aesgcm_download.h +++ b/src/tools/aesgcm_download.h @@ -50,7 +50,7 @@ typedef struct aesgcm_download_t { - char* id; + gchar* id; char* url; char* filename; char* cmd_template; diff --git a/src/xmpp/connection.c b/src/xmpp/connection.c index 97562786..72ea0e3d 100644 --- a/src/xmpp/connection.c +++ b/src/xmpp/connection.c @@ -830,10 +830,10 @@ connection_free_uuid(char* uuid) } } -char* +gchar* connection_create_stanza_id(void) { - auto_char char* rndid = get_random_string(CON_RAND_ID_LEN); + auto_gchar gchar* rndid = get_random_string(CON_RAND_ID_LEN); assert(rndid != NULL); auto_gchar gchar* hmac = g_compute_hmac_for_string(G_CHECKSUM_SHA1, diff --git a/src/xmpp/jid.c b/src/xmpp/jid.c index 6b5bb62c..cdb36628 100644 --- a/src/xmpp/jid.c +++ b/src/xmpp/jid.c @@ -203,7 +203,7 @@ jid_fulljid_or_barejid(Jid* jid) gchar* jid_random_resource(void) { - auto_char char* rand = get_random_string(4); + auto_gchar gchar* rand = get_random_string(4); gchar* result = g_strdup_printf("profanity.%s", rand);