Repository : ssh://git@open-mesh.org/alfred
On branch : master
commit 1606d72d88515c01941ce919679fcc49c44cc63f Author: Sven Eckelmann sven@open-mesh.com Date: Mon Sep 9 17:46:06 2013 +0200
alfred: Fix crash when vis opened empty file
Signed-off-by: Sven Eckelmann sven@open-mesh.com Signed-off-by: Simon Wunderlich simon@open-mesh.com
1606d72d88515c01941ce919679fcc49c44cc63f 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; }