Skip to content

Commit

Permalink
Fixes build on unixes by swapping sprintf_s to snprintf.
Browse files Browse the repository at this point in the history
  • Loading branch information
rokups committed Jun 9, 2018
1 parent 0b17440 commit f9106ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ImSequencer.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "ImSequencer.h"
#include "imgui.h"
#include "imgui_internal.h"

#include <cstdlib>

namespace ImSequencer
{
Expand Down Expand Up @@ -58,7 +58,7 @@ namespace ImSequencer
ImGui::InvisibleButton("canvas", ImVec2(canvas_size.x - canvas_pos.x, (float)ItemHeight));
draw_list->AddRectFilled(canvas_pos, ImVec2(canvas_size.x + canvas_pos.x, canvas_pos.y + ItemHeight), 0xFF3D3837, 0);
char tmps[512];
sprintf_s(tmps, sizeof(tmps), "%d Frames / %d entries", frameCount, sequenceCount);
snprintf(tmps, sizeof(tmps), "%d Frames / %d entries", frameCount, sequenceCount);
draw_list->AddText(ImVec2(canvas_pos.x + 26, canvas_pos.y + 2), 0xFFFFFFFF, tmps);
}
else
Expand Down Expand Up @@ -166,7 +166,7 @@ namespace ImSequencer
if (baseIndex)
{
char tmps[512];
sprintf_s(tmps, sizeof(tmps), "%d", (i == frameCount) ? i : (i / 10));
snprintf(tmps, sizeof(tmps), "%d", (i == frameCount) ? i : (i / 10));
draw_list->AddText(ImVec2((float)px + 3.f, canvas_pos.y), 0xFFBBBBBB, tmps);
}
}
Expand Down Expand Up @@ -234,7 +234,7 @@ namespace ImSequencer
{
ImGui::CaptureMouseFromApp();
int diffFrame = (cx - movingPos) / framePixelWidth;
if (abs(diffFrame) > 0)
if (std::abs(diffFrame) > 0)
{
int *start, *end;
sequence->Get(movingEntry, &start, &end, NULL, NULL);
Expand Down

0 comments on commit f9106ce

Please sign in to comment.