1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04:00

str_to_uofft is a tiny wrapper over strtoul{,l}

This commit is contained in:
LemonBoy 2016-06-05 16:54:20 +02:00
parent cc70e8c581
commit 2e8744319d

View File

@ -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 */