I have my code running in Linux. I see my program getting aborted when a NULL is passed to strchr() function. This doesn't seem to happen when running in AIX.
Can anyone tell why this difference in behavior for strchr() ?
Thanks
I have my code running in Linux. I see my program getting aborted when a NULL is passed to strchr() function. This doesn't seem to happen when running in AIX.
Can anyone tell why this difference in behavior for strchr() ?
Thanks
Copyright © 2021 Jogjafile Inc.
Because the spec for strchr() doesn't specify the "correct" behavior when passed a NULL, so different implementations are free to, uh, implement it differently for that case. (Just curious: what does the AIX version return when passed a NULL?)