diff options
author | Keith Packard <keithp@keithp.com> | 2014-01-29 12:54:25 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-08-20 12:58:05 -0700 |
commit | 8c0f5228e75aa949963aa8d27dcfa2648db2e197 (patch) | |
tree | 99889d7b1a6c9668681142b68b0ca6c0b1dfc58f /Xtranssock.c | |
parent | 3309c75906a56de86607f59481304b3a2812162f (diff) |
move is_numeric to Xtranssock.c and only define for TCPCONN or TRANS_REOPEN
Don't define this function unless it is actually going to be used.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'Xtranssock.c')
-rw-r--r-- | Xtranssock.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Xtranssock.c b/Xtranssock.c index 0177186..84159e8 100644 --- a/Xtranssock.c +++ b/Xtranssock.c @@ -196,6 +196,20 @@ static Sockettrans2dev Sockettrans2devtab[] = { static int TRANS(SocketINETClose) (XtransConnInfo ciptr); #endif +#if defined(TCPCONN) || defined(TRANS_REOPEN) +static int +is_numeric (const char *str) +{ + int i; + + for (i = 0; i < (int) strlen (str); i++) + if (!isdigit (str[i])) + return (0); + + return (1); +} +#endif + #ifdef UNIXCONN |