1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.2.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<title>STD_GetStringNLength</title> 9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">STD_GetStringNLength<img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></h1> 15<h2>Syntax</h2> 16<dl> 17 <dd><PRE><CODE>#include <nitro/std.h> 18 19int STD_GetStringNLength( char* str, int len );</CODE></PRE> 20 <PRE><CODE>int STD_StrNLen( char* str, int len ); 21</CODE></PRE></dd> 22</dl> 23 24<h2>Arguments</h2> 25<table border="1" width="100%"> 26 <tbody> 27 <TR> 28 <TD width="200"><EM><STRONG><FONT face="Courier New">str</FONT></STRONG></EM></TD> 29 <TD width="800">Specifies the string pointer.</TD> 30 </TR> 31 <TR> 32 <TD width="200"><EM><STRONG><FONT face="Courier New">len</FONT></STRONG></EM></TD> 33 <TD width="800">Specifies the maximum return value.</TD> 34 </TR> 35 </tbody> 36</table> 37 38<h2>Return Values</h2> 39<p> 40Returns the string length when it is less than <SPAN class="argument">len</SPAN>. Returns <SPAN class="argument">len</SPAN> otherwise. 41</p> 42 43<H2>Description</H2> 44<P> 45Finds the length of string <EM><STRONG><CODE>str</CODE></STRONG></EM>. If it is longer than <SPAN class="argument">len</SPAN>, however, <SPAN class="argument">len</SPAN> is returned. This has the same behavior as the <CODE>strnlen</CODE> function in the C standard library. By specifying <SPAN class="argument">len</SPAN> as the size of the array (region) that stores a string, you can prevent an abnormally large string count from being returned when the string overflows the region. 46</P> 47<P> 48<CODE>STD_StrNLen</CODE> is defined as another name for <CODE>STD_GetStringNLength</CODE>. 49</P> 50 51<h2>See Also</h2> 52<P> 53 <CODE> 54 <A href="STD_GetStringLength.html">STD_GetStringLength</A> 55 </CODE> 56</P> 57 58 59<H2>Revision History</H2> 60<P> 612008/07/31 Initial version. 62</P> 63<hr><p>CONFIDENTIAL</p></body> 64</html> 65