char *getInput2(char *param) {
int data_len;
data_len=atoi(getenv("CONTENT_LENGTH"));
char input[9];
fgets(input, 9, stdin);
return strdup (input+6);
}
and
char *getInput2(char *param) {
char input[9];
fgets(input, 9, stdin);
return strdup (input+6);
}
why the ouptut of above functons are different?
for example the post value is
max_n=20
first functions output:”x_n”
second functions output:”20″
This functions is same, first
getInput2doing something more but result of this calculations is not usable in future instructions.But when
CONTENT_LENGHTnot exists then youatoigetsNULLand her code was stop from Debug Assertion.