--- a/progs/test.c Sun Oct 05 18:20:31 2014 +0100
+++ b/progs/test.c Mon Oct 06 00:57:44 2014 +0100
@@ -28,20 +28,20 @@
void foo (char *bar)
{
- long my_long = 10; // in hex: \xF2\x03\x00\x00
+ unsigned long long my_long = 101010101; // in hex: \xB5\x4A\x05\x06
char buffer[28];
- printf("my_long value = %lu\n", my_long);
+ printf("my_long value = %llu\n", my_long);
strcpy(buffer, bar);
- printf("my_long value = %lu\n", my_long);
+ printf("my_long value = %llu\n", my_long);
}
int main (int argc, char **argv)
{
- foo("my string is too long !!!!! "); // all is normal
- foo("my string is too long !!!!! \x00\x00\x07\xE4"); // overwrites my_long
+ foo("my string is too long !!!!!"); // all is normal
+ foo("my string is too long !!!!! \x15\xcd\x5b\x07"); // overwrites my_long
return 0;
}