• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <stdio.h>
2 #include <stdlib.h>
3 
main(int argc,const char * argv[])4 int main(int argc, const char* argv[])
5 {
6     int *null_ptr = 0;
7     printf("Hello, fault!\n");
8     u_int32_t val = (arc4random() & 0x0f);
9     printf("val=%u\n", val);
10     if (val == 0x07) // Lucky 7 :-)
11         printf("Now segfault %d\n", *null_ptr);
12     else
13         printf("Better luck next time!\n");
14 }
15