Fixes

Hi,

here are two patches.

The first is a better cross platform implementation of get_user_config_dir() with fallbacks.

The second fixes a possible buffer overflow if the provided buffer is smaller then the m->name_length.