How come char[3] can be displayed with more than 3 characters?
First off, I'm not sure how you're declaring an array with a length specified at run-time. This is standard C, right?

What's probably causing your problem is that ssid_determined is not null-terminated. The size of ssid_determined should be name_length + 1, and the final character should be '\0'.