strnlenのヘルプ・マニュアル
日本語 英語
strnlen --help
man strnlen
STRNLEN(3) Linux Programmer’s Manual STRNLEN(3)
名前
strnlen - 固定長の文字列の長さを調べる
書式
#define _GNU_SOURCE
#include
size_t strnlen(const char *s, size_t maxlen);
説明
strnlen() 関数は s が指す文字列の長さをバイト数で返す。長さには終端の
'\0' 文字を含まない。また長さは最大で maxlen までであり、 strnlen() は
s の最初の maxlen バイトのみを検査し s+maxlen より先を検査することはな
い。
返り値
strnlen() 関数は maxlen 以下ならば strlen(s) と同じ値を返す。s の指す文
字 列が最大 maxlen バイトまでに '\0' 文字を含まない場合には maxlen を返
す。
準拠
この関数は GNU の拡張である。
関連項目
strlen(3), feature_test_macros(7)
GNU 1999-07-25 STRNLEN(3)
STRNLEN(3) Linux Programmer’s Manual STRNLEN(3)
NAME
strnlen - determine the length of a fixed-size string
SYNOPSIS
#define _GNU_SOURCE
#include
size_t strnlen(const char *s, size_t maxlen);
DESCRIPTION
The strnlen() function returns the number of characters in the string
pointed to by s, not including the terminating '\0' character, but at
most maxlen. In doing this, strnlen() looks only at the first maxlen
characters at s and never beyond s+maxlen.
RETURN VALUE
The strnlen() function returns strlen(s), if that is less than maxlen,
or maxlen if there is no '\0' character among the first maxlen charac-
ters pointed to by s.
CONFORMING TO
This function is a GNU extension.
SEE ALSO
strlen(3), feature_test_macros(7)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 1999-07-25 STRNLEN(3)