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/imagenet.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/imagenet.c b/src/imagenet.c
index c826a0f..567a8c4 100644
--- a/src/imagenet.c
+++ b/src/imagenet.c
@@ -152,15 +152,17 @@
     int i = 0;
     char **names = get_labels("data/shortnames.txt");
     clock_t time;
-    char input[256];
     int indexes[10];
+    char buff[256];
+    char *input = buff;
     while(1){
         if(filename){
             strncpy(input, filename, 256);
         }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, 256, 256);

--
Gitblit v1.10.0