equal
deleted
inserted
replaced
|
1 #include <string.h> |
|
2 #include <stdio.h> |
|
3 #include <stdlib.h> |
|
4 |
|
5 void foo (char *bar) |
|
6 { |
|
7 float my_float = 10.5; // in hex: \x41\x28\x00\x00 |
|
8 char buffer[28]; |
|
9 |
|
10 printf("my float value = %f\n", my_float); |
|
11 |
|
12 strcpy(buffer, bar); |
|
13 |
|
14 printf("my float value = %f\n", my_float); |
|
15 } |
|
16 |
|
17 int main (int argc, char **argv) |
|
18 { |
|
19 foo("my string is too long !!!!! "); // all is normal |
|
20 //foo("my string is too long !!!!! \x10\x10\xc0\x42"); // overwrites my_float |
|
21 return 0; |
|
22 } |
|
23 |