summary refs log tree commit diff
path: root/src/sdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdl.c')
-rw-r--r--src/sdl.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/sdl.c b/src/sdl.c
index 0072c87..18ab7d0 100644
--- a/src/sdl.c
+++ b/src/sdl.c
@@ -11,19 +11,12 @@
 
 static const int WINDOW_WIDTH = 160, WINDOW_HEIGHT = 90;
 
-struct blob {
-	void *data;
-	size_t size;
-};
-
 SDL_Window *window = NULL;
 
 struct blob load_file(char const *const name);
 
-struct userdata {
-	SDL_AudioCallback callback;
-	void *user;
-} userdata = {
+#include "include.h"
+struct userdata userdata = {
 	.callback = NULL,
 	.user = NULL,
 };
@@ -137,7 +130,7 @@ struct blob load_file(char const *const name) {
 		data = newdata;
 	}
 	void *const newdata = realloc(data, used);
-	if (newdata == NULL) {
+	if (newdata == NULL && used != 0) {
 		goto realloc_error;
 	}
 	fclose(file);