From f40bda81bfb2c8d3d3ba6698695e2bedef9da278 Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Thu, 12 Oct 2017 20:36:15 -0400 Subject: Fixed segfault --- examples/pcm-writei.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/pcm-writei.c b/examples/pcm-writei.c index 66280eb..2c97f54 100644 --- a/examples/pcm-writei.c +++ b/examples/pcm-writei.c @@ -20,21 +20,21 @@ static size_t read_file(void ** frames){ FILE * input_file = fopen("audio.raw", "rb"); if (input_file == NULL) { perror("failed to open 'audio.raw' for writing"); - return -1; + return 0; } long int size = file_size(input_file); if (size < 0) { perror("failed to get file size of 'audio.raw'"); fclose(input_file); - return -1; + return 0; } *frames = malloc(size); if (*frames == NULL) { fprintf(stderr, "failed to allocate frames\n"); fclose(input_file); - return -1; + return 0; } size = fread(*frames, 1, size, input_file); -- cgit v1.2.3