File: strndup.3

package info (click to toggle)
publib 0.28
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 1,500 kB
  • ctags: 768
  • sloc: ansic: 7,768; makefile: 336; sh: 152
file content (22 lines) | stat: -rw-r--r-- 753 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.\" part of publib
.\" "@(#)publib-strutil:$Id: strndup.3,v 1.1 1994/06/20 20:30:23 liw Exp $"
.\"
.TH STRNDUP 3 "C Programmer's Manual" Publib "C Programmer's Manual"
.SH NAME
strndup \- duplicate part of a string
.SH SYNOPSIS
.nf
#include <publib.h>
char *\fBstrndup\fR(const char *\fIstr\fR, size_t \fIn\fR);
.SH DESCRIPTION
\fIstrndup\fR will make a duplicate of the \fIn\fR first characters
of \fIstr\fR, using \fImalloc\fR(3) to allocate memory for the
duplicate.  The caller is supposed to free the duplicate's memory
when no longer needed.
.SH "RETURN VALUE"
\fIstrndup\fR will return a pointer to the duplicate, or NULL if no
memory could be allocated.
.SH "SEE ALSO"
publib(3), strdup(3)
.SH AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)