2 * convert binary form of address range to ASCII
3 * Copyright (C) 1998, 1999 Henry Spencer.
5 * This library is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU Library General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/lgpl.txt>.
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 * License for more details.
15 * RCSID $Id: rangetoa.c,v 1.5 1999/04/10 23:24:21 henry Exp $
21 - rangetoa - convert address range to ASCII
23 size_t /* space needed for full conversion */
24 rangetoa(addrs, format, dst, dstlen)
25 struct in_addr addrs[2];
26 int format; /* character */
27 char *dst; /* need not be valid if dstlen is 0 */
43 len = addrtoa(addrs[0], 0, dst, dstlen);
45 for (p = dst + len - 1, n = 3; len < dstlen && n > 0;
54 *(dst + dstlen - 1) = '\0';
58 len += addrtoa(addrs[1], 0, p, rest);