LenToASCIIZStr

Converts a length-preceded string to an ASCIIZ (null-terminated) string.

Library:LibC
Service:Characters and Strings

Syntax

  #include <string.h> 
   
  int LenToASCIIZStr (
     char         *destStr, 
     const char   *srcStr);
  

Parameters

destStr

(OUT) Points to the destination string.

srcStr

(IN) Points to the source string.

Return Values

If successful, returns 0. Otherwise, returns the number of characters not copied to the destination string.

Remarks

The LenToASCIIZStr function copies and converts a length-preceded string to an ASCIIZ (null-terminated) string.

The srcStr string is only copied up to the first NULL character. If the string is not converted (because of a NULL character being encountered), the value returned is the number of characters not copied to the destination string.

The srcStr parameter is an ASCII string with the length of the string in the first byte and the actual characters of the string following it.

The srcStr can be the same as the destStr.