mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-03-26 07:57:57 -04:00
Revert "src/topology/parser.c: drop duplicate safe_strtol_base"
This reverts commit 47252054b4.
This commit is contained in:
parent
47252054b4
commit
0a1fd4b8f7
1 changed files with 19 additions and 0 deletions
|
|
@ -21,6 +21,25 @@
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "tplg_local.h"
|
#include "tplg_local.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Safe strtol call
|
||||||
|
*/
|
||||||
|
int safe_strtol_base(const char *str, long *val, int base)
|
||||||
|
{
|
||||||
|
char *end;
|
||||||
|
long v;
|
||||||
|
if (!*str)
|
||||||
|
return -EINVAL;
|
||||||
|
errno = 0;
|
||||||
|
v = strtol(str, &end, base);
|
||||||
|
if (errno)
|
||||||
|
return -errno;
|
||||||
|
if (*end)
|
||||||
|
return -EINVAL;
|
||||||
|
*val = v;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get integer value
|
* Get integer value
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue