diff --git a/simulate/simulate.cc b/simulate/simulate.cc index 0b2a150a..db0821d2 100644 --- a/simulate/simulate.cc +++ b/simulate/simulate.cc @@ -2476,7 +2476,14 @@ void Simulate::Render() { // show pause/loading label if (!this->run || this->loadrequest) { - const char* label = this->loadrequest ? "LOADING..." : "PAUSE"; + char label[30] = {'\0'}; + if (this->loadrequest) { + std::snprintf(label, sizeof(label), "LOADING..."); + } if (this->scrub_index == 0) { + std::snprintf(label, sizeof(label), "PAUSE"); + } else { + std::snprintf(label, sizeof(label), "PAUSE (%d)", this->scrub_index); + } mjr_overlay(mjFONT_BIG, mjGRID_TOP, smallrect, label, nullptr, &this->platform_ui->mjr_context()); }