use tmp->name instead of name in log messages, because name is not 0-terminated