don't truncate lines, don't allow tabs to back up (I think this is tested!)
[unix-history] / usr / src / lib / libc / string / strdup.3
CommitLineData
03623f75
KB
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\" @(#)strdup.3 5.1 (Berkeley) %G%
7.\"
8.TH STRDUP 3 ""
9.UC 7
10.SH NAME
11strdup \- save a copy of a string
12.SH SYNOPSIS
13.nf
14.ft B
15#include <string.h>
16
17char *
18strdup(const char *str);
19.ft R
20.fi
21.SH DESCRIPTION
22.I Strdup
23allocates sufficient memory for a copy of the string
24.IR str ,
25does the copy, and returns a pointer to it.
26The pointer may subsequently be used as an argument to the function
27.IR free (3).
28.PP
29.I Strdup
30returns NULL if unable to allocate the necessary memory.
31.SH SEE ALSO
32malloc(3)