mirror of
https://github.com/irssi/irssi.git
synced 2026-08-08 19:30:15 +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 */
|
||||
uoff_t str_to_uofft(const char *str)
|
||||
{
|
||||
uoff_t ret;
|
||||
|
||||
ret = 0;
|
||||
while (*str != '\0') {
|
||||
ret = ret*10 + (*str - '0');
|
||||
str++;
|
||||
}
|
||||
|
||||
return ret;
|
||||
#ifdef UOFF_T_LONG_LONG
|
||||
return (uoff_t)strtoull(str, NULL, 10);
|
||||
#else
|
||||
return (uoff_t)strtoul(str, NULL, 10);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* convert all low-ascii (<32) to ^<A..> combinations */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue