(parse_answer0,parse_answer1): Use strtoul instead of strtoumax. This is a temporary change.
Showing
1 changed file
with
7 additions
and
5 deletions
... | @@ -1024,30 +1024,32 @@ pop_get_message (mu_mailbox_t mbox, size_t msgno, mu_message_t *pmsg) | ... | @@ -1024,30 +1024,32 @@ pop_get_message (mu_mailbox_t mbox, size_t msgno, mu_message_t *pmsg) |
1024 | return 0; | 1024 | return 0; |
1025 | } | 1025 | } |
1026 | 1026 | ||
1027 | /* FIXME: Should use strtoumax ideally */ | ||
1027 | static int | 1028 | static int |
1028 | parse_answer0 (const char *buffer, size_t *n1, size_t *n2) | 1029 | parse_answer0 (const char *buffer, size_t *n1, size_t *n2) |
1029 | { | 1030 | { |
1030 | char *p; | 1031 | char *p; |
1031 | uintmax_t m; | 1032 | unsigned long m; |
1032 | if (strlen (buffer) < 3 || memcmp (buffer, "+OK", 3)) | 1033 | if (strlen (buffer) < 3 || memcmp (buffer, "+OK", 3)) |
1033 | return 1; | 1034 | return 1; |
1034 | m = *n1 = strtoumax (buffer + 3, &p, 10); | 1035 | m = *n1 = strtoul (buffer + 3, &p, 10); |
1035 | if (!isspace (*p) || m != *n1) | 1036 | if (!isspace (*p) || m != *n1) |
1036 | return 1; | 1037 | return 1; |
1037 | m = *n2 = strtoumax (p, &p, 10); | 1038 | m = *n2 = strtoul (p, &p, 10); |
1038 | if (!(*p == 0 || isspace (*p)) || m != *n2) | 1039 | if (!(*p == 0 || isspace (*p)) || m != *n2) |
1039 | return 1; | 1040 | return 1; |
1040 | return 0; | 1041 | return 0; |
1041 | } | 1042 | } |
1042 | 1043 | ||
1044 | /* FIXME: Should use strtoumax ideally */ | ||
1043 | static int | 1045 | static int |
1044 | parse_answer1 (const char *buffer, size_t *n1, char *buf, size_t bufsize) | 1046 | parse_answer1 (const char *buffer, size_t *n1, char *buf, size_t bufsize) |
1045 | { | 1047 | { |
1046 | char *p; | 1048 | char *p; |
1047 | uintmax_t m; | 1049 | unsigned long m; |
1048 | if (strlen (buffer) < 3 || memcmp (buffer, "+OK", 3)) | 1050 | if (strlen (buffer) < 3 || memcmp (buffer, "+OK", 3)) |
1049 | return 1; | 1051 | return 1; |
1050 | m = *n1 = strtoumax (buffer + 3, &p, 0); | 1052 | m = *n1 = strtoul (buffer + 3, &p, 0); |
1051 | if (!isspace (*p) || m != *n1) | 1053 | if (!isspace (*p) || m != *n1) |
1052 | return 1; | 1054 | return 1; |
1053 | while (*p && isspace (*p)) | 1055 | while (*p && isspace (*p)) | ... | ... |
-
Please register or sign in to post a comment