From 4f0c543fb7796005f4e0bfa43869e179ce52936b Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 9 Feb 2015 15:34:20 +0100 Subject: [PATCH] File closen.. --- ass2/chris/sws1-s4109503-s4202015/exercise1b.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ass2/chris/sws1-s4109503-s4202015/exercise1b.c b/ass2/chris/sws1-s4109503-s4202015/exercise1b.c index f1c9f23..4a844dc 100644 --- a/ass2/chris/sws1-s4109503-s4202015/exercise1b.c +++ b/ass2/chris/sws1-s4109503-s4202015/exercise1b.c @@ -1,12 +1,12 @@ #include int main(){ - FILE *fp; - fp = fopen("/dev/urandom","r"); + FILE *fp = fopen("/dev/urandom","r"); char buffer = 0; do{ fread(&buffer, 1, 1, fp); printf("%i %u %#x \n",buffer, buffer, buffer); } while(buffer != 42); + fclose(fp); return 0; } -- 2.20.1