aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/twitter/twitter.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2012-11-25 22:09:41 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2012-11-25 22:09:41 +0000
commit67f68282bb20ad3af6dfa6017b89b89ab0a1767f (patch)
treec406e21911b70dcc1312b8ff67f0573d02e13c34 /protocols/twitter/twitter.c
parentf97b8e9637acba704e976dff79436a83c0f9c63a (diff)
Only a few commands use twitter_message_id_from_command_arg(), others were
still using a decimal scanf format string. Messy code duplication. :-(
Diffstat (limited to 'protocols/twitter/twitter.c')
-rw-r--r--protocols/twitter/twitter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c
index fdfc83ec..91050578 100644
--- a/protocols/twitter/twitter.c
+++ b/protocols/twitter/twitter.c
@@ -591,7 +591,7 @@ static void twitter_handle_command(struct im_connection *ic, char *message)
if (cmd[1] == NULL)
twitter_status_destroy(ic, td->last_status_id);
- else if (sscanf(cmd[1], "%" G_GUINT64_FORMAT, &id) == 1) {
+ else if (sscanf(cmd[1], "%" G_GINT64_MODIFIER "x", &id) == 1) {
if (id < TWITTER_LOG_LENGTH && td->log)
id = td->log[id].id;
@@ -626,7 +626,7 @@ static void twitter_handle_command(struct im_connection *ic, char *message)
/* Report nominally works on users but look up the user who
posted the given ID if the user wants to do it that way */
if (g_str_has_prefix(cmd[1], "#") &&
- sscanf(cmd[1] + 1, "%" G_GUINT64_FORMAT, &id) == 1) {
+ sscanf(cmd[1] + 1, "%" G_GINT64_MODIFIER "x", &id) == 1) {
if (id < TWITTER_LOG_LENGTH && td->log) {
if (g_slist_find(ic->bee->users, td->log[id].bu)) {
screen_name = td->log[id].bu->handle;
@@ -654,7 +654,7 @@ static void twitter_handle_command(struct im_connection *ic, char *message)
guint64 id = 0;
if (g_str_has_prefix(cmd[1], "#") &&
- sscanf(cmd[1] + 1, "%" G_GUINT64_FORMAT, &id) == 1 &&
+ sscanf(cmd[1] + 1, "%" G_GINT64_MODIFIER "x", &id) == 1 &&
(id < TWITTER_LOG_LENGTH) && td->log) {
bu = td->log[id].bu;
if (g_slist_find(ic->bee->users, bu))
@@ -664,7 +664,7 @@ static void twitter_handle_command(struct im_connection *ic, char *message)
} else if ((bu = bee_user_by_handle(ic->bee, ic, cmd[1])) &&
(tud = bu->data) && tud->last_id) {
id = tud->last_id;
- } else if (sscanf(cmd[1], "%" G_GUINT64_FORMAT, &id) == 1 &&
+ } else if (sscanf(cmd[1], "%" G_GINT64_MODIFIER "x", &id) == 1 &&
(id < TWITTER_LOG_LENGTH) && td->log) {
bu = td->log[id].bu;
if (g_slist_find(ic->bee->users, bu))