Skip to content

Commit

Permalink
fix minor bugs in samples
Browse files Browse the repository at this point in the history
  • Loading branch information
willamowius committed Aug 16, 2018
1 parent b27dea6 commit 477a78b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions samples/audio/audio.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ TestAudio::TestAudio(TestAudioDevice &master)
{
iterations = 0;
keepGoing = PTrue;
currentVolume = 0;
}

TestAudio::~TestAudio()
Expand Down
2 changes: 1 addition & 1 deletion samples/strtest/main.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class StringHolder
const char * ptr = C::ToConstCharStar(s);
//const char * ptr = s.c_str();
char buffer[20];
strncpy(buffer, ptr, 20);
strncpy(buffer, ptr, sizeof(buffer)-1);

if (strcmp((const char *)buffer, SPECIALNAME)) {
finishFlag = PTrue;
Expand Down
2 changes: 1 addition & 1 deletion samples/timing/timing.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void TimingTest::Main()
oldSec++;
PTimeInterval newTick = PTimer::Tick();
PTimeInterval oldTick = newTick;
unsigned count = 0;
unsigned count = 1;

while (oldSec == time(NULL)) { // For one full second
while (newTick == oldTick)
Expand Down

0 comments on commit 477a78b

Please sign in to comment.