lstrlen function
Determines the length of the specified string (not including the terminating null character).
Syntax
int WINAPI lstrlen(
_In_ LPCTSTR lpString
);
Parameters
- lpString [in]
-
Type: LPCTSTR
The null-terminated string to be checked.
Return value
Type: int
The function returns the length of the string, in characters. If lpString is NULL, the function returns 0.
Security Considerations
Security Warning
Using this function incorrectly can compromise the security of your application. lstrlen assumes that lpString is a null-terminated string, or NULL. If it is not, this could lead to a buffer overrun or a denial of service attack against your application.
Consider using one of the following alternatives: StringCbLength or StringCchLength.
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
lstrlenW (Unicode) and lstrlenA (ANSI) |
See also
- Reference
- StringCbLength
- StringCchLength
- lstrcat
- lstrcmp
- lstrcmpi
- lstrcpy
- Conceptual
- Strings