OSDN Git Service

(split) LDP: Update draft and release (from the previous commit)
[linuxjm/LDP_man-pages.git] / draft / man3 / getline.3
index e941bbd..f9db5f7 100644 (file)
@@ -69,9 +69,9 @@ _GNU_SOURCE
 \fBgetline\fP()  は \fIstream\fP から 1 行全てを読み込み、テキストが含まれているバッファのアドレスを \fI*lineptr\fP
 に格納する。 バッファはヌル文字 (\e0) で終端される。 改行文字が見つかった場合は、改行文字もバッファに格納される。
 
-If \fI*lineptr\fP is set to NULL and \fI*n\fP is set 0 before the call, then
-\fBgetline\fP()  will allocate a buffer for storing the line.  This buffer
-should be freed by the user program even if \fBgetline\fP()  failed.
+\fI*lineptr\fP が NULL にセットされ、 \fI*n\fP が呼び出し前に 0 にセットされた場合、 \fBgetline\fP()
+は行の内容を格納するためのバッファを確保する。 このバッファは、 \fBgetline\fP()
+が失敗した場合であっても、ユーザーのプログラムで解放すべきである。
 
 別の方法として、 \fBgetline\fP()  を呼び出す際に、 \fI*lineptr\fP に \fBmalloc\fP(3)  で確保した大きさ \fI*n\fP
 バイトのバッファへのポインタを入れて渡すこともできる。 読み込んだ行を保持するのに十分なバッファがない場合、 \fBgetline\fP()  は