mirror of
https://github.com/troglobit/finit.git
synced 2026-10-26 12:14:37 +00:00
The atonum() function is now provied by libite.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
b30678bbe9
commit
0fd9aa6497
3 files changed
+1
-27
No files matched your search
@@ -39,30 +39,6 @@
|
||||
#include "private.h"
|
||||
#include "libite/lite.h"
|
||||
|
||||
|
||||
/**
|
||||
* atonum - Convert string to integer
|
||||
* @str: String value to convert.
|
||||
*
|
||||
* Returns:
|
||||
* The converted (positive) number, or -1 on error, with @errno set.
|
||||
*/
|
||||
int atonum(char *str)
|
||||
{
|
||||
int val;
|
||||
char *end;
|
||||
|
||||
if (!str)
|
||||
return -1;
|
||||
|
||||
errno = 0;
|
||||
val = strtol(str, &end, 10);
|
||||
if (errno || end == str)
|
||||
return -1;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static int encode(int lvl)
|
||||
{
|
||||
if (!lvl) return 0;
|
||||
|
||||
Reference in new issue
Block a user