From efd75efa3e8f10abf73eed92ed205b3b28300e82 Mon Sep 17 00:00:00 2001 From: thedmd Date: Mon, 7 Dec 2020 10:30:35 +0100 Subject: [PATCH] Example: Reintegrate Widgets example from @crolando (#77) (fixup) --- examples/widgets-example/widgets-example.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/widgets-example/widgets-example.cpp b/examples/widgets-example/widgets-example.cpp index f164e10bc..803f1c0eb 100644 --- a/examples/widgets-example/widgets-example.cpp +++ b/examples/widgets-example/widgets-example.cpp @@ -26,8 +26,10 @@ namespace ed = ax::NodeEditor; # ifdef _MSC_VER # define portable_strcpy strcpy_s +# define portable_sprintf sprintf_s # else # define portable_strcpy strcpy +# define portable_sprintf sprintf # endif struct Example: @@ -349,7 +351,7 @@ struct Example: float progress_saturated = (progress < 0.0f) ? 0.0f : (progress > 1.0f) ? 1.0f : progress; char buf[32]; - sprintf_s(buf, "%d/%d", (int)(progress_saturated * 1753), 1753); + portable_sprintf(buf, "%d/%d", (int)(progress_saturated * 1753), 1753); ImGui::ProgressBar(progress, ImVec2(0.f, 0.f), buf); ImGui::PopItemWidth();