Ignore:
Timestamp:
2012-11-25T22:09:41Z (11 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
b235228
Parents:
f97b8e9
Message:

Only a few commands use twitter_message_id_from_command_arg(), others were
still using a decimal scanf format string. Messy code duplication. :-(

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter.c

    rf97b8e9 r67f6828  
    592592                if (cmd[1] == NULL)
    593593                        twitter_status_destroy(ic, td->last_status_id);
    594                 else if (sscanf(cmd[1], "%" G_GUINT64_FORMAT, &id) == 1) {
     594                else if (sscanf(cmd[1], "%" G_GINT64_MODIFIER "x", &id) == 1) {
    595595                        if (id < TWITTER_LOG_LENGTH && td->log)
    596596                                id = td->log[id].id;
     
    627627                   posted the given ID if the user wants to do it that way */
    628628                if (g_str_has_prefix(cmd[1], "#") &&
    629                     sscanf(cmd[1] + 1, "%" G_GUINT64_FORMAT, &id) == 1) {
     629                    sscanf(cmd[1] + 1, "%" G_GINT64_MODIFIER "x", &id) == 1) {
    630630                        if (id < TWITTER_LOG_LENGTH && td->log) {
    631631                                if (g_slist_find(ic->bee->users, td->log[id].bu)) {
     
    655655
    656656                if (g_str_has_prefix(cmd[1], "#") &&
    657                     sscanf(cmd[1] + 1, "%" G_GUINT64_FORMAT, &id) == 1 &&
     657                    sscanf(cmd[1] + 1, "%" G_GINT64_MODIFIER "x", &id) == 1 &&
    658658                    (id < TWITTER_LOG_LENGTH) && td->log) {
    659659                        bu = td->log[id].bu;
     
    665665                    (tud = bu->data) && tud->last_id) {
    666666                        id = tud->last_id;
    667                 } else if (sscanf(cmd[1], "%" G_GUINT64_FORMAT, &id) == 1 &&
     667                } else if (sscanf(cmd[1], "%" G_GINT64_MODIFIER "x", &id) == 1 &&
    668668                           (id < TWITTER_LOG_LENGTH) && td->log) {
    669669                        bu = td->log[id].bu;
Note: See TracChangeset for help on using the changeset viewer.