Changeset 73f0a01 for protocols


Ignore:
Timestamp:
2015-05-31T02:31:24Z (4 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
2ca933c
Parents:
6e21525
Message:

Move twitter_parse_id() to parse_int64() in misc.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter.c

    r6e21525 r73f0a01  
    859859}
    860860
    861 /* Parses a decimal or hex tweet ID, returns TRUE on success */
    862 static gboolean twitter_parse_id(char *string, int base, guint64 *id)
    863 {
    864         guint64 parsed;
    865         char *endptr;
    866 
    867         errno = 0;
    868         parsed = g_ascii_strtoull(string, &endptr, base);
    869         if (errno || endptr == string || *endptr != '\0') {
    870                 return FALSE;
    871         }
    872         *id = parsed;
    873         return TRUE;
    874 }
    875 
    876 bee_user_t twitter_log_local_user;
    877 
    878861/** Convert the given bitlbee tweet ID, bitlbee username, or twitter tweet ID
    879862 *  into a twitter tweet ID.
     
    903886                        arg++;
    904887                }
    905                 if (twitter_parse_id(arg, 16, &id) && id < TWITTER_LOG_LENGTH) {
     888                if (parse_int64(arg, 16, &id) && id < TWITTER_LOG_LENGTH) {
    906889                        bu = td->log[id].bu;
    907890                        id = td->log[id].id;
    908                 } else if (twitter_parse_id(arg, 10, &id)) {
     891                } else if (parse_int64(arg, 10, &id)) {
    909892                        /* Allow normal tweet IDs as well; not a very useful
    910893                           feature but it's always been there. Just ignore
Note: See TracChangeset for help on using the changeset viewer.