libs/libvtrutil/src/vtr_util.cpp
/* An alternate for strncpy since strncpy doesn't work as most
 * people would expect. This ensures null termination */
An alternate for strncpy since strncpy doesn't work as most
people would expect. This ensures null termination
An alternate for strncpy since strncpy doesn ' t work as most people would expect . This ensures null termination
char* strncpy(char* dest, const char* src, size_t size) {
    size_t len = std::strlen(src);
    if (size <= len)
        len = (size - 1);
    std::memcpy(dest, src, len);
    dest[len] = '\0';
    return dest;
}
char * strncpy ( char * dest , const char * src , size_t size ) { size_t len = std :: strlen ( src ) ; if ( size <= len ) len = ( size - 1 ) ; std :: memcpy ( dest , src , len ) ; dest [ len ] = ' \0 ' ; return dest ; }
An alternate for strncpy since strncpy doesn't work as most
 people would expect.
An alternate for strncpy since strncpy doesn ' t work as most people would expect .
/* Find string's length */ /* Cap length at (num - 1) to leave room for \0 */ /* Copy as much of string as we can fit */ /* explicit null termination */