From f996bd59a61338d8d51e2b19482d684f6dd04d0f Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Wed, 23 Sep 2015 21:16:48 +0000
Subject: [PATCH] more writing fixes

---
 src/dice.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/dice.c b/src/dice.c
index 7948741..fdc535e 100644
--- a/src/dice.c
+++ b/src/dice.c
@@ -76,7 +76,8 @@
     srand(2222222);
     int i = 0;
     char **names = dice_labels;
-    char input[256];
+    char buff[256];
+    char *input = buff;
     int indexes[6];
     while(1){
         if(filename){
@@ -84,7 +85,8 @@
         }else{
             printf("Enter Image Path: ");
             fflush(stdout);
-            fgets(input, 256, stdin);
+            input = fgets(input, 256, stdin);
+            if(!input) return;
             strtok(input, "\n");
         }
         image im = load_image_color(input, net.w, net.h);

--
Gitblit v1.10.0