From: Richard L. <rl...@us...> - 2005-11-25 17:23:08
|
Update of /cvsroot/gaim/gaim/src/protocols/gg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27139 Modified Files: utils.c utils.h Log Message: 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. Index: utils.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/gg/utils.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- utils.c 25 Nov 2005 16:38:07 -0000 1.4 +++ utils.c 25 Nov 2005 17:22:54 -0000 1.5 @@ -24,8 +24,8 @@ #include "utils.h" -/* static uin_t ggp_str_to_uin(const char *text) {{{ */ -uin_t ggp_str_to_uin(const char *text) +/* uin_t ggp_str_to_uin(const char *str) {{{ */ +uin_t ggp_str_to_uin(const char *str) { char *tmp; long num; @@ -34,7 +34,7 @@ uin_t ggp_str_to_uin(const char *text) return 0; errno = 0; - num = strtol(text, &tmp, 0); + num = strtol(text, &tmp, 10); if (*text == '\0' || *tmp != '\0') return 0; Index: utils.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/gg/utils.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- utils.h 8 Nov 2005 19:45:09 -0000 1.2 +++ utils.h 25 Nov 2005 17:22:54 -0000 1.3 @@ -39,13 +39,13 @@ /* - * Convert string to number. Check wheter a given - * string is a correct UIN. + * Convert a base 10 string to a UIN. * - * Return UIN or 0 if an error occurred. + * @param str The string to convert + * @return UIN or 0 if an error occurred. */ uin_t -ggp_str_to_uin(const char *text); +ggp_str_to_uin(const char *str); /** * Convert enconding of a given string. |