.\" Copyright (c) Bruno Haible .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" References consulted: .\" GNU glibc-2 source code and manual .\" .\" Corrected, aeb, 990824 .\" .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya .\" all rights reserved. .\" Translated Tue Jan 11 00:55:50 JST 2000 .\" by HANATAKA Shinya .\" .TH STPNCPY 3 2010-09-15 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O stpncpy \- copy a fixed-size string, returning a pointer to its end stpncpy \- 固定長の文字列をコピーして、その最後へのポインターを返す .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "char *stpncpy(char *" dest ", const char *" src ", size_t " n ); .fi .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .BR stpncpy (): .PD 0 .ad l .RS 4 .TP 4 .\"O Since glibc 2.10: glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L .TP .\"O Before glibc 2.10: glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR stpncpy () .\"O function copies at most \fIn\fP characters from the string .\"O pointed to by \fIsrc\fP, including the terminating \(aq\\0\(aq character, .\"O to the array pointed to by \fIdest\fP. .\"O Exactly \fIn\fP characters are written at .\"O \fIdest\fP. .\"O If the length \fIstrlen(src)\fP is smaller than \fIn\fP, the .\"O remaining characters in the array pointed to by \fIdest\fP are filled .\"O with \(aq\\0\(aq characters. .\"O If the length \fIstrlen(src)\fP is greater or equal to .\"O \fIn\fP, the string pointed to by \fIdest\fP will .\"O not be \(aq\\0\(aq terminated. .BR stpncpy () 関数は \fIsrc\fP が指している文字列から終端の \(aq\\0\(aq 文字を 含めて最大 \fIn\fP バイトを \fIdest\fP にコピーする。長さ \fIstrlen(src)\fP が \fIn\fP より小さい場合には \fIdest\fP の残りの 部分には \(aq\\0\(aq 文字が埋められる。長さ \fIstrlen(src)\fP が \fIn\fP 以上 ならば、\fIdest\fP が指す文字列は \(aq\\0\(aq で終端されていない。 .PP .\"O The strings may not overlap. 二つの文字列は重なってはならない。 .PP .\"O The programmer must ensure that there is room for at least \fIn\fP characters .\"O at \fIdest\fP. プログラマーは \fIdest\fP に少なくとも \fIn\fP バイトの空きがあることを 保証しなければならない。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O .BR stpncpy () .\"O returns a pointer to the terminating null .\"O in \fIdest\fP, or, if \fIdest\fP is not null-terminated, .\"O \fIdest + n\fP. .BR stpncpy () は \fIdest\fP の終端のナル文字を指すポインターを返すか、 \fIdest\fP がナル文字で終端されていない場合には \fIdest + n\fP を返す。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O This function is a GNU extension. この関数は GNU の拡張である。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR strncpy (3), .BR wcpncpy (3)