diff options
author | Safey A.Halim <safey.allah@gmail.com> | 2010-08-31 13:54:32 +0000 |
---|---|---|
committer | Safey A.Halim <safey.allah@gmail.com> | 2010-08-31 13:54:32 +0000 |
commit | 630cb3becfc26fa786ac9567305a928771225445 (patch) | |
tree | 4e475bd23398743fb54a40a4f2816f8973c30ddc /src/monkey/bug_null_pointer_exception.c | |
parent | 40d0c1ce4ca68910f4bdb9666cd5bc651d160a0c (diff) | |
download | gnunet-630cb3becfc26fa786ac9567305a928771225445.tar.gz gnunet-630cb3becfc26fa786ac9567305a928771225445.zip |
Monkey sends e-mails reporting bugs detected using gdbmi
C.jj grammar for C
Diffstat (limited to 'src/monkey/bug_null_pointer_exception.c')
-rw-r--r-- | src/monkey/bug_null_pointer_exception.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/monkey/bug_null_pointer_exception.c b/src/monkey/bug_null_pointer_exception.c index 977fb088c..072904b6d 100644 --- a/src/monkey/bug_null_pointer_exception.c +++ b/src/monkey/bug_null_pointer_exception.c | |||
@@ -3,25 +3,15 @@ | |||
3 | 3 | ||
4 | void crashFunction() | 4 | void crashFunction() |
5 | { | 5 | { |
6 | //char *stringCannotBeChanged = "String cannot be changed!"; | ||
7 | char *nullString = NULL; | 6 | char *nullString = NULL; |
8 | 7 | printf("Now the program will crash!\n"); | |
9 | printf("Now the program will crash! Take a cover! \n"); | ||
10 | //*stringCannotBeChanged = 'h'; | ||
11 | printf("Nonsense!\n"); | ||
12 | if (strcmp(nullString, "A string to compare with") == 0) { | 8 | if (strcmp(nullString, "A string to compare with") == 0) { |
13 | printf("How come?! It had to be crashed!\n"); | 9 | printf("How come?! It had to crash!\n"); |
14 | } | 10 | } |
15 | } | 11 | } |
16 | 12 | ||
17 | int main(int argc, char *argv[]) | 13 | int main(int argc, char *argv[]) |
18 | { | 14 | { |
19 | int i; | ||
20 | printf("arguments: %d\n", argc); | ||
21 | for (i=0; i<argc; i++) | ||
22 | printf("%d: %s\n", i, argv[i]); | ||
23 | printf("Press ENTER\n"); | ||
24 | getchar(); | ||
25 | crashFunction(); | 15 | crashFunction(); |
26 | return 0; | 16 | return 0; |
27 | } | 17 | } |