mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
str_to_uofft is a tiny wrapper over strtoul{,l}
This commit is contained in:
parent
cc70e8c581
commit
2e8744319d
@ -515,15 +515,11 @@ int dec2octal(int decimal)
|
|||||||
/* string -> uoff_t */
|
/* string -> uoff_t */
|
||||||
uoff_t str_to_uofft(const char *str)
|
uoff_t str_to_uofft(const char *str)
|
||||||
{
|
{
|
||||||
uoff_t ret;
|
#ifdef UOFF_T_LONG_LONG
|
||||||
|
return (uoff_t)strtoull(str, NULL, 10);
|
||||||
ret = 0;
|
#else
|
||||||
while (*str != '\0') {
|
return (uoff_t)strtoul(str, NULL, 10);
|
||||||
ret = ret*10 + (*str - '0');
|
#endif
|
||||||
str++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* convert all low-ascii (<32) to ^<A..> combinations */
|
/* convert all low-ascii (<32) to ^<A..> combinations */
|
||||||
|
Loading…
Reference in New Issue
Block a user