xref: /freebsd/contrib/sendmail/libsm/ilenx.c (revision bdd1243df58e60e85101c09001d9812a789b6bc4)
1 /*
2  * Copyright (c) 2020 Proofpoint, Inc. and its suppliers.
3  *	All rights reserved.
4  *
5  * By using this file, you agree to the terms and conditions set
6  * forth in the LICENSE file which can be found at the top level of
7  * the sendmail distribution.
8  *
9  */
10 
11 #include <sm/gen.h>
12 #include <sm/sendmail.h>
13 #include <sm/ixlen.h>
14 
15 #if _FFR_8BITENVADDR
16 /*
17 **  ILENX -- determine the e'x'ternal length of a string in 'i'internal format
18 **
19 **	Parameters:
20 **		str -- string [i]
21 **
22 **	Returns:
23 **		e'x'ternal length of a string in 'i'internal format
24 */
25 
26 int
27 ilenx(str)
28 	const char *str;
29 {
30 	char c;
31 	int idx;
32 	XLENDECL
33 
34 	if (NULL == str)
35 		return -1;
36 	for (idx = 0; (c = str[idx]) != '\0'; idx++)
37 		XLEN(c);
38 	return xlen;
39 }
40 #endif /* _FFR_8BITENVADDR */
41