]> git.alsa-project.org Git - alsa-lib.git/commitdiff
src/topology/parser.c: drop duplicate safe_strtol_base
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sat, 1 Jan 2022 16:20:47 +0000 (17:20 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sat, 1 Jan 2022 16:50:27 +0000 (17:50 +0100)
The safe_strtol_base() function is defined twice since
f547b2e3 ("conf: introduce safe_strtol_base()") and
5fab157a ("topology: do not call strtol directly")
resulting in the following build failure when alsa-utils is built
statically because safe_strtol_base is defined twice.

Fixes: http://autobuild.buildroot.org/results/08d028004090b2a8292f03910cb9bf80a73ac804
Fixes: https://github.com/alsa-project/alsa-lib/pull/207
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/topology/parser.c

index 01c95afaa13f2226fac6215b2ab0e15c2dd20e6e..e70173f612827217e7dc1e14d5c139b1b28d1347 100644 (file)
 #include "list.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
  */