a
authorMart Lubbers <mart@martlubbers.net>
Mon, 9 Feb 2015 15:01:06 +0000 (16:01 +0100)
committerMart Lubbers <mart@martlubbers.net>
Mon, 9 Feb 2015 15:01:06 +0000 (16:01 +0100)
ass2/mart/sws1-s4109503-s4202015/exercise1d
ass2/mart/sws1-s4109503-s4202015/exercise1d.c

index 89a79b9..ac54af0 100755 (executable)
Binary files a/ass2/mart/sws1-s4109503-s4202015/exercise1d and b/ass2/mart/sws1-s4109503-s4202015/exercise1d differ
index 07dfa41..93dba64 100644 (file)
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -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);