equal
deleted
inserted
replaced
26 */ |
26 */ |
27 |
27 |
28 |
28 |
29 void foo (char *bar) |
29 void foo (char *bar) |
30 { |
30 { |
31 long my_long = 10; // in hex: \xF2\x03\x00\x00 |
31 unsigned long long my_long = 101010101; // in hex: \xB5\x4A\x05\x06 |
32 char buffer[28]; |
32 char buffer[28]; |
33 |
33 |
34 printf("my_long value = %lu\n", my_long); |
34 printf("my_long value = %llu\n", my_long); |
35 |
35 |
36 strcpy(buffer, bar); |
36 strcpy(buffer, bar); |
37 |
37 |
38 printf("my_long value = %lu\n", my_long); |
38 printf("my_long value = %llu\n", my_long); |
39 } |
39 } |
40 |
40 |
41 int main (int argc, char **argv) |
41 int main (int argc, char **argv) |
42 { |
42 { |
43 foo("my string is too long !!!!! "); // all is normal |
43 foo("my string is too long !!!!!"); // all is normal |
44 foo("my string is too long !!!!! \x00\x00\x07\xE4"); // overwrites my_long |
44 foo("my string is too long !!!!! \x15\xcd\x5b\x07"); // overwrites my_long |
45 return 0; |
45 return 0; |
46 } |
46 } |
47 |
47 |