From: Mart Lubbers Date: Mon, 9 Feb 2015 15:01:06 +0000 (+0100) Subject: a X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=e9ab09f0bf2126c52376221df097d3f88cde180a;p=sws1-1415.git a --- diff --git a/ass2/mart/sws1-s4109503-s4202015/exercise1d b/ass2/mart/sws1-s4109503-s4202015/exercise1d index 89a79b9..ac54af0 100755 Binary files a/ass2/mart/sws1-s4109503-s4202015/exercise1d and b/ass2/mart/sws1-s4109503-s4202015/exercise1d differ diff --git a/ass2/mart/sws1-s4109503-s4202015/exercise1d.c b/ass2/mart/sws1-s4109503-s4202015/exercise1d.c index 07dfa41..93dba64 100644 --- a/ass2/mart/sws1-s4109503-s4202015/exercise1d.c +++ b/ass2/mart/sws1-s4109503-s4202015/exercise1d.c @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -7,7 +7,7 @@ int main(void) FILE *f = fopen("/dev/urandom", "r"); uint16_t c; do { - c = fgetc(f)+fgetc(f)*256; + c = fscanf(f, SCNu16); printf("%04x\n", c); } while(c != 42); fclose(f);