nog korter ex2
[sws1-1415.git] / ass4 / mart / sws1-assignment4-s4109503-s4202015 / exercise2.c
index 4343e61..5a3f570 100644 (file)
@@ -5,9 +5,9 @@
 void heap_attack(void)
 {
        char *b = malloc(1);
-       while(memcmp(--b, "s4109503", 8) != 0);
-       b += 8;
-       while(memcmp(b, "s4202015", 8) != 0)
+       while(memcmp(--b, "4109503", 8) != 0);
+       b += 7;
+       while(memcmp(b, "4202015", 8) != 0)
                *b++ = ' ';
 }
 
@@ -19,8 +19,8 @@ int  main(void)
        char *s2 = malloc(8);
        if(s2 == NULL)
                return -1;
-       strcpy(s1, "s4109503");
-       strcpy(s2, "s4202015");
+       strcpy(s1, "4109503");
+       strcpy(s2, "4202015");
        heap_attack();
        printf("student 1: \"%s\"\n", s1);
        printf("student 2: \"%s\"\n", s2);