]> git.lizzy.rs Git - nothing.git/commitdiff
(#893) Fix color_picker_read_from_line_stream
authorrexim <reximkut@gmail.com>
Sun, 16 Jun 2019 18:38:45 +0000 (01:38 +0700)
committerrexim <reximkut@gmail.com>
Sun, 16 Jun 2019 18:38:45 +0000 (01:38 +0700)
src/game/level/level_editor/color_picker.c

index 05527a2f4d865d5b06051ac18d76331d9c871d18..474c043c0670a3aefdff48dcba06812c423e07d4 100644 (file)
@@ -3,6 +3,7 @@
 #include "game/level/boxes.h"
 #include "system/stacktrace.h"
 #include "system/line_stream.h"
+#include "system/log.h"
 #include "game/camera.h"
 #include "proto_rect.h"
 #include "color_picker.h"
@@ -37,6 +38,10 @@ int color_picker_read_from_line_stream(ColorPicker *color_picker,
         return -1;
     }
 
+    if (sscanf(line, "%6s", color) == EOF) {
+        log_fail("Could not read color\n");
+    }
+
     color_picker->color = hexstr(color);
 
     return 0;