Mercurial > pidgin
comparison src/protocols/gg/utils.c @ 12224:e84fbd0be612
[gaim-migrate @ 14526]
Bartosz Oler suggested this change to strtol() in ggp_str_to_uin(). I asked if it was really necessary...
(17:00:29) Bartosz Oler (liar): Hm. UINs are base 10 numbers. And it might be hard to trace a bug if user will accidentally type his number with a leading zero. I see no usecase for ggp_str_to_uin with octal numbers.
That seems reasonable to me. I cleaned up the documentation for this function a little.
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Fri, 25 Nov 2005 17:22:54 +0000 |
| parents | 546c292b7f98 |
| children | 078f39bdf3d4 |
comparison
equal
deleted
inserted
replaced
| 12223:546c292b7f98 | 12224:e84fbd0be612 |
|---|---|
| 22 | 22 |
| 23 | 23 |
| 24 #include "utils.h" | 24 #include "utils.h" |
| 25 | 25 |
| 26 | 26 |
| 27 /* static uin_t ggp_str_to_uin(const char *text) {{{ */ | 27 /* uin_t ggp_str_to_uin(const char *str) {{{ */ |
| 28 uin_t ggp_str_to_uin(const char *text) | 28 uin_t ggp_str_to_uin(const char *str) |
| 29 { | 29 { |
| 30 char *tmp; | 30 char *tmp; |
| 31 long num; | 31 long num; |
| 32 | 32 |
| 33 if (!text) | 33 if (!text) |
| 34 return 0; | 34 return 0; |
| 35 | 35 |
| 36 errno = 0; | 36 errno = 0; |
| 37 num = strtol(text, &tmp, 0); | 37 num = strtol(text, &tmp, 10); |
| 38 | 38 |
| 39 if (*text == '\0' || *tmp != '\0') | 39 if (*text == '\0' || *tmp != '\0') |
| 40 return 0; | 40 return 0; |
| 41 | 41 |
| 42 if ((errno == ERANGE || (num == LONG_MAX || num == LONG_MIN)) | 42 if ((errno == ERANGE || (num == LONG_MAX || num == LONG_MIN)) |
