diff options
author | Brendan Taylor <whateley@gmail.com> | 2011-02-15 11:36:03 -0700 |
---|---|---|
committer | Brendan Taylor <whateley@gmail.com> | 2011-02-15 11:36:03 -0700 |
commit | 681cb249c31e4e17e3ae9b8f68b10d7f33fea402 (patch) | |
tree | 2ec13d9a2713dc5a3923badc90ce0941dceaae2e /src | |
parent | e5c2785c5de5230d49be57e172e925a99895b52f (diff) |
replace itos() with g_strdup_printf()
Diffstat (limited to 'src')
-rw-r--r-- | src/callbacks.c | 2 | ||||
-rw-r--r-- | src/util.c | 9 | ||||
-rw-r--r-- | src/util.h | 1 | ||||
-rw-r--r-- | src/uzbl-core.c | 2 |
4 files changed, 2 insertions, 12 deletions
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); } @@ -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); @@ -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); } |