Corrected & refactored handling of window bar content...

Old snprintf calls could have overflowed the buffers.