mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 17:12:51 +02:00
str_to_uofft is a tiny wrapper over strtoul{,l}
This commit is contained in:
parent
cc70e8c581
commit
2e8744319d
1 changed files with 5 additions and 9 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue