NWstrncpy

Copies a locale-sensitive string for a specified number of characters (not bytes)

NetWare Server:4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform Localization (LOC*.*)
Service:Internationalization

Syntax

  #include <time.h> or #define NWL_EXCLUDE_TIME 
  #include <stdio.h> or #define NWL_EXCLUDE_FILE 
  #include <nwlocale.h> 
   
  pnstr N_API NWstrncpy ( 
     pnstr              target_string,  
     const nstr N_FAR  *source_string,  
     nint               numChars); 
  
  

Pascal Syntax

  uses netwin32 
   
  Function NWstrncpy 
    (target_string : pnstr; 
     source_string : pnstr; 
     numChars      : nint 
  ) : pnstr; 
  
  

Parameters

target_string
(OUT) Points to the string to which to copy.
source_string
(IN) Points to the string to be copied.
numChars
(IN) Specifies the number of characters to copy.

Return Values

NULL

The target_string parameter and/or the source string parameter is NULL

non-NULL

Pointer to the target_string parameter

Remarks

NWstrncpy copies a string of up to the number of characters specified by the numChars parameter to the destination string and NULL-terminates the string if the source string contains less characters than the number specified by the numChars parameter. However, unlike the ANSI strncpy function, NWstrncpy does not pad any remaining space in the destination string with NULLs.

To guarantee a NULL-terminated string, set the numChars parameter equal to the length of the target_string parameter minus one and set the last element of the target_string parameter equal to zero.

See Also

NWLsetlocale