Changeset 73f0a01 for protocols/twitter
- Timestamp:
- 2015-05-31T02:31:24Z (9 years ago)
- Branches:
- master
- Children:
- 2ca933c
- Parents:
- 6e21525
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
r6e21525 r73f0a01 859 859 } 860 860 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 878 861 /** Convert the given bitlbee tweet ID, bitlbee username, or twitter tweet ID 879 862 * into a twitter tweet ID. … … 903 886 arg++; 904 887 } 905 if ( twitter_parse_id(arg, 16, &id) && id < TWITTER_LOG_LENGTH) {888 if (parse_int64(arg, 16, &id) && id < TWITTER_LOG_LENGTH) { 906 889 bu = td->log[id].bu; 907 890 id = td->log[id].id; 908 } else if ( twitter_parse_id(arg, 10, &id)) {891 } else if (parse_int64(arg, 10, &id)) { 909 892 /* Allow normal tweet IDs as well; not a very useful 910 893 feature but it's always been there. Just ignore
Note: See TracChangeset
for help on using the changeset viewer.