strncpy_m Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
strncpy_m Function
C
size_t strncpy_m(
    char* destStr, 
    size_t destSize, 
    int nStrings, 
    ...
);
Description

Copies multiple strings to a destination but doesn't copy more than destSize characters. Useful where the destination is actually an array and an extra 0 won't be appended to overflow the buffer

Preconditions
  • valid string pointers
  • destSize should be > 0
Parameters
Parameters 
Description 
destStr 
Pointer to a string to be initialized with the multiple strings provided as arguments.
 
destSize 
the maximum size of the destStr field, that cannot be exceeded. An 0 won't be appended if the resulting size is > destSize
 
nStrings 
number of string parameters to be copied into destStr
 
... 
variable number of arguments 
Returns

Length of the destination string, terminating 0 (if exists) not included

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.