A for loop condition is always false so pnd->name is not initialized. This results in garbage when printing device name.