Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
WinRT: modified the loopwave test to run if and when argv is NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLudwig committed Nov 23, 2012
1 parent 30e298d commit 264534e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/loopwave.c
Expand Up @@ -78,18 +78,22 @@ poked(int sig)
int
main(int argc, char *argv[])
{
char filename[4096];

/* Load the SDL library */
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
return (1);
}

if (argv[1] == NULL) {
argv[1] = "sample.wav";
if (argc >= 1) {
SDL_strlcpy(filename, argv[1], sizeof(filename));
} else {
SDL_strlcpy(filename, "sample.wav", sizeof(filename));
}
/* Load the wave file into memory */
if (SDL_LoadWAV(argv[1], &wave.spec, &wave.sound, &wave.soundlen) == NULL) {
fprintf(stderr, "Couldn't load %s: %s\n", argv[1], SDL_GetError());
if (SDL_LoadWAV(filename, &wave.spec, &wave.sound, &wave.soundlen) == NULL) {
fprintf(stderr, "Couldn't load %s: %s\n", filename, SDL_GetError());
quit(1);
}

Expand Down

0 comments on commit 264534e

Please sign in to comment.