From 681cb249c31e4e17e3ae9b8f68b10d7f33fea402 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Tue, 15 Feb 2011 11:36:03 -0700 Subject: replace itos() with g_strdup_printf() --- src/callbacks.c | 2 +- src/util.c | 9 --------- src/util.h | 1 - src/uzbl-core.c | 2 +- 4 files changed, 2 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/callbacks.c b/src/callbacks.c index c261234..9bc5c28 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -441,7 +441,7 @@ void progress_change_cb (WebKitWebView* web_view, GParamSpec param_spec) { (void) param_spec; int progress = webkit_web_view_get_progress(web_view) * 100; - gchar *prg_str = itos(progress); + gchar *prg_str = g_strdup_printf("%d", progress); send_event(LOAD_PROGRESS, prg_str, NULL); g_free(prg_str); } diff --git a/src/util.c b/src/util.c index f56eb57..ead07b5 100644 --- a/src/util.c +++ b/src/util.c @@ -177,15 +177,6 @@ find_existing_file(gchar* path_list) { return NULL; } - -char* -itos(int val) { - char tmp[20]; - - snprintf(tmp, sizeof(tmp), "%i", val); - return g_strdup(tmp); -} - gchar* argv_idx(const GArray *a, const guint idx) { return g_array_index(a, gchar*, idx); diff --git a/src/util.h b/src/util.h index 388c202..87fe53a 100644 --- a/src/util.h +++ b/src/util.h @@ -16,5 +16,4 @@ char* str_replace(const char* search, const char* replace, const char* str gboolean for_each_line_in_file(const gchar *path, void (*callback)(const gchar *l, void *c), void *user_data); enum exp_type get_exp_type(const gchar*); gchar* find_existing_file(gchar*); -char* itos(int val); gchar* argv_idx(const GArray*, const guint); diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 129d14a..4c709f7 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -1782,7 +1782,7 @@ main (int argc, char* argv[]) { send_event(INSTANCE_START, uzbl.info.pid_str, NULL); if (uzbl.state.plug_mode) { - char *t = itos(gtk_plug_get_id(uzbl.gui.plug)); + char *t = g_strdup_printf("%d", gtk_plug_get_id(uzbl.gui.plug)); send_event(PLUG_CREATED, t, NULL); g_free(t); } -- cgit v1.2.3