Look at this 2 simples programs in C:
#include <stdio.h>
int main(int argc, char *argv[]) {
return -1;
}
#include <stdio.h>
int main(int argc, char *argv[]) {
return 1337;
}
Now look this very basic python script:
>>> import subprocess
>>> r=subprocess.call(['./a.out'])
I do not understand why but the python script r value contains:
- 255 for the first C program. It should be -1
- 57 for the second C program. It should be 1337
Have i something wrong ?
Thanks
-1 == 255 unsigned byte...1337&255= 57