Signed-off-by: Sven Eckelmann <[email protected]>
---
 vis/vis.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vis/vis.c b/vis/vis.c
index 5e7a109..36ea7fe 100644
--- a/vis/vis.c
+++ b/vis/vis.c
@@ -59,7 +59,8 @@ static char *read_file(char *fname)
        }
        fclose(fp);
 
-       buf[size] = 0;
+       if (buf)
+               buf[size] = 0;
 
        return buf;
 }
-- 
1.8.4.rc3

Reply via email to