progs/test1.c
author Christian Urban <urbanc@in.tum.de>
Sat, 21 Jan 2017 00:37:20 +0000
changeset 510 51267a687b85
parent 208 204564b899a0
permissions -rw-r--r--
updated test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
207
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
#include <string.h>
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
#include <stdio.h>
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
#include <stdlib.h>
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
void foo (char *bar)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
{
208
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 207
diff changeset
     7
   long my_long = 101010101;    // in hex: \xB5\x4A\x05\x06
207
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
int main (int argc, char **argv)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
  foo("my string is too long !!!!!");                  // all is normal
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
  foo("my string is too long !!!!! \x15\xcd\x5b\x07"); // overwrites my_long
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
  return 0;
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16