Merge branch 'master' of github.com:dopefishh/sws1
authorMart Lubbers <mart@martlubbers.net>
Mon, 9 Feb 2015 15:01:54 +0000 (16:01 +0100)
committerMart Lubbers <mart@martlubbers.net>
Mon, 9 Feb 2015 15:01:54 +0000 (16:01 +0100)
Conflicts:
ass2/mart/sws1-s4109503-s4202015/exercise1d
ass2/mart/sws1-s4109503-s4202015/exercise1d.c

ass2/mart/sws1-s4109503-s4202015/exercise1d.c

index 3200729..7555bc9 100644 (file)
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <inttypes.h>
 #include <stdio.h>
 
 int main(void)
@@ -6,7 +6,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);