diff options
author | John Hernandez <129467592+H3rnand3zzz@users.noreply.github.com> | 2023-04-19 02:44:19 +0200 |
---|---|---|
committer | John Hernandez <129467592+H3rnand3zzz@users.noreply.github.com> | 2023-05-04 16:15:09 +0200 |
commit | 7f3fca2bd081a729d425184f7a0484025862257e (patch) | |
tree | 20f1cd78bf48f7d6ceb95bb0262faf691001bcf9 /src/tools/http_upload.c | |
parent | faccf24c759d7bddb4d3062c7f044e0c7640ffe7 (diff) | |
download | profani-tty-7f3fca2bd081a729d425184f7a0484025862257e.tar.gz |
Cleanup: gchar as gchar instead of char
Use gchar instead of char in most of the cases where gchar is intended. Reason: improve compatibility and stability. Issue #1819 Minor refactoring.
Diffstat (limited to 'src/tools/http_upload.c')
-rw-r--r-- | src/tools/http_upload.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tools/http_upload.c b/src/tools/http_upload.c index 4dae41c5..289dba15 100644 --- a/src/tools/http_upload.c +++ b/src/tools/http_upload.c @@ -399,15 +399,13 @@ file_mime_type(const char* const filename) size_t file_header_size = fread(file_header, 1, FILE_HEADER_BYTES, fh); fclose(fh); - char* content_type = g_content_type_guess(filename, (unsigned char*)file_header, file_header_size, NULL); + auto_gchar gchar* content_type = g_content_type_guess(filename, (unsigned char*)file_header, file_header_size, NULL); if (content_type != NULL) { - char* mime_type = g_content_type_get_mime_type(content_type); + auto_gchar gchar* mime_type = g_content_type_get_mime_type(content_type); out_mime_type = strdup(mime_type); - g_free(mime_type); } else { return strdup(FALLBACK_MIMETYPE); } - g_free(content_type); return out_mime_type; } |