aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTaylor Holberton <taylorcholberton@gmail.com>2017-10-12 20:36:15 -0400
committerTaylor Holberton <taylorcholberton@gmail.com>2017-10-12 20:36:15 -0400
commitf40bda81bfb2c8d3d3ba6698695e2bedef9da278 (patch)
treecf9ec6aea6696d012cce0dbd3f70b028c582c991 /examples
parent093b87878bb1fabb2077d412c46cfd9b15998f8d (diff)
Fixed segfault
Diffstat (limited to 'examples')
-rw-r--r--examples/pcm-writei.c6
1 files changed, 3 insertions, 3 deletions
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);