Thanks Salem!

>> It might be safer in the long run to implement your own wrapper function.
Seems like FreeBSD's ifconfig implementation uses a similar approach to the one you suggested and they implemented a function that handles the (char *) to uint8_t conversion issue (the get_string() function that is internally used by ifconfig utility [1])

>> Be wary that doing something along the lines of
>> memcpy(dest,src,destLen);
>> may lead to out of bound memory read accesses if src is pointing to a short string.
I was trying to figure out a solution for the same problem you pointed out with memcpy(), i.e. data overflow when src is not long enough to store all data in dst. But I will stick with strlcpy() and try to write something similar to get_string().

@ algorishm,
>> You said memset (not memcpy) in your previous post. That's what threw me.
Sorry, a typo! It should have been memcpy() as you pointed out!

Thanks for your replies!

[1] https://svnweb.freebsd.org/base/head...w=markup#l5260