carb::memory::protectedStrncpy
Defined in carb/memory/Util.h
- 
inline bool carb::memory::protectedStrncpy(char *dest, const char *source, size_t n)
- Copies memory as via strncpy, but returns false if an access violation occurs while reading. - Thread Safety
- This function is safe to call concurrently. However, this function makes no guarantees about the consistency of data copied when the data is modified while copied, only the attempting to read invalid memory will not result in an access violation. 
 - Warning - This function is designed for safety, not performance, and may be very slow to execute. - Warning - The source and dest buffers may not overlap. - Parameters
- dest – The destination buffer that will receive the memory. Must be at least - nbytes in size.
- source – The source buffer. Up to - nbytes will be copied.
- n – The maximum number of characters of - sourceto copy to- dest. If no- NULcharacter was encountered in the first- n - 1characters of- source, then- dest[n - 1]will be a- NULcharacter. This is a departure from- strncpy()but similar to- strncpy_s().
 
- Returns
- trueif the memory was successfully copied;- falseotherwise. If- falseis returned,- destis in a valid but undefined state.