I have a simple C program that prints out argc:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
printf("argc = %d\n", argc);
return 0;
}
I'm trying to test it with inputs given by python commands in the command line, but I get the following error:
C:\Users...\bin\Debug>python -c "print('A')" | pwnable.exe
argc = 1
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='cp1252'>
OSError: [Errno 22] Invalid argument
prints out 1 instead of 2.
Why does this error appear, and what does it mean?