* Replacing strdup() with strndup() throughout