widgets: use snprintf instead of sprintf