1 /*
2 * Copyright (c) 1998-2007, 2009 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
11 *
12 */
13
14 #include <sendmail.h>
15
16 SM_RCSID("@(#)$Id: util.c,v 8.416 2009/12/18 17:05:26 ca Exp $")
17
18 #include <sm/sendmail.h>
19 #include <sysexits.h>
20 #include <sm/xtrap.h>
21
22 /*
23 ** NEWSTR -- Create a copy of a C string
24 **
25 ** Parameters:
26 ** s -- the string to copy.
27 **
28 ** Returns:
29 ** pointer to newly allocated string.
30 */
31
32 char *
33 newstr(s)
34 const char *s;
35 {
36 size_t l;
37 char *n;
38
39 l = strlen(s);
40 SM_ASSERT(l + 1 > l);
|
1 /*
2 * Copyright (c) 1998-2007, 2009 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
11 *
12 */
13
14 #include <sendmail.h>
15
16 SM_RCSID("@(#)$Id: util.c,v 8.416 2009/12/18 17:05:26 ca Exp $")
17
18 #include <sm/sendmail.h>
19 #include <sysexits.h>
20 #include <sm/xtrap.h>
21 #include <sys/types.h>
22 #include <sys/mkdev.h>
23
24 /*
25 ** NEWSTR -- Create a copy of a C string
26 **
27 ** Parameters:
28 ** s -- the string to copy.
29 **
30 ** Returns:
31 ** pointer to newly allocated string.
32 */
33
34 char *
35 newstr(s)
36 const char *s;
37 {
38 size_t l;
39 char *n;
40
41 l = strlen(s);
42 SM_ASSERT(l + 1 > l);
|