summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorLogan Rathbone <poprocks@gmail.com>2021-12-29 23:49:48 -0500
committerLogan Rathbone <poprocks@gmail.com>2021-12-29 23:49:48 -0500
commit6da301644c82049dc7d0b4a701a481000379893f (patch)
tree4bbae604b7bc92b30d496e322f10c06d845c0e91 /src/util.c
parent7db5575f2bba510a88aa56d0bcb295b9a07ab104 (diff)
downloadzenity-6da301644c82049dc7d0b4a701a481000379893f.tar.gz
Use g_auto* where possible.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/util.c b/src/util.c
index f126840..d0dcc3f 100644
--- a/src/util.c
+++ b/src/util.c
@@ -55,7 +55,7 @@ zenity_util_load_ui_file (const char *root_widget, ...)
char *arg = NULL;
GPtrArray *ptrarray;
GtkBuilder *builder = gtk_builder_new ();
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
char **objects;
gboolean result = FALSE;
@@ -98,7 +98,6 @@ zenity_util_load_ui_file (const char *root_widget, ...)
if (error) {
g_debug ("%s: Error generated: %s",
__func__, error->message);
- g_error_free (error);
}
return builder;
@@ -180,13 +179,10 @@ zenity_util_fill_file_buffer (GtkTextBuffer *buffer, const char *filename) {
void
zenity_util_show_help (GError **error) {
- char *tmp;
- tmp = g_find_program_in_path ("yelp");
+ g_autofree char *tmp = g_find_program_in_path ("yelp");
- if (tmp) {
- g_free (tmp);
+ if (tmp)
g_spawn_command_line_async ("yelp help:zenity", error);
- }
}
int
@@ -305,6 +301,8 @@ zenity_util_pango_font_description_to_css (PangoFontDescription *desc)
case PANGO_VARIANT_SMALL_CAPS:
g_string_append (s, "font-variant: small-caps; ");
break;
+ default:
+ break;
}
}
if (set & PANGO_FONT_MASK_WEIGHT)