- Timestamp:
- 2015-02-22T21:19:21Z (10 years ago)
- Branches:
- master
- Children:
- 91f06e5
- Parents:
- 273949d
- git-author:
- dequis <dx@…> (22-02-15 05:00:37)
- git-committer:
- dequis <dx@…> (22-02-15 21:19:21)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
r273949d r552c8a5 852 852 } 853 853 854 /* Parses a decimal or hex tweet ID, handling errors by returning 0 */ 855 static guint64 twitter_parse_id(char *string, int base) 856 { 857 guint64 parsed; 858 char *endptr; 859 860 errno = 0; 861 parsed = g_ascii_strtoull(string, &endptr, base); 862 if (errno || endptr == string || *endptr == '\0') { 863 return 0; 864 } 865 return parsed; 866 } 867 854 868 /** Convert the given bitlbee tweet ID, bitlbee username, or twitter tweet ID 855 869 * into a twitter tweet ID. … … 879 893 arg++; 880 894 } 881 if (sscanf(arg, "%" G_GINT64_MODIFIER "x", &id) == 1 && 882 id < TWITTER_LOG_LENGTH) { 895 if ((id = twitter_parse_id(arg, 16)) && id < TWITTER_LOG_LENGTH) { 883 896 bu = td->log[id].bu; 884 897 id = td->log[id].id; … … 887 900 bu = NULL; 888 901 } 889 } else if ( sscanf(arg, "%" G_GINT64_MODIFIER "d", &id) == 1) {902 } else if ((id = twitter_parse_id(arg, 10))) { 890 903 /* Allow normal tweet IDs as well; not a very useful 891 904 feature but it's always been there. Just ignore
Note: See TracChangeset
for help on using the changeset viewer.