[PATCH v2 2/3] server: Replace sprintf with snprintf to avoid deprecation warnings on macOS.