Hi, I have c++ generated executable in solaris 8. the problem i am having is that this executable uses a cmd line param to run.
for example,
$ myprog 123412341234AB
this is a valid 14 digit hexdecimal value. however, if for some reason there are symbols like ^ > < >> << & etc then the program does not behave properly per say. i am not talking core dumps per say but for example one of the checks i do is via isxdigit. apparently its not good enough to catch something like 1234123412341^ or 12341234(12341
so i am just trying to see if i can detect all these symbols in an effort to just exit properly. i mean some of these symbols have special meaning in unix and i guess that is why the prog does not understand how to handle it.
any thoughts on how to address this ? do i just try to find all these symbols and the moment i detect them in the cmd like i just exit out with an error message? how would i go about doing this?
i am using std::string. So maybe a list like !@#$%^&*()<><<>> etc where i can detect and get out. i am not sure if there is an easier way to do this so unix does not think i am giving it a system command when in fact its just an input to a program albeit it just happens to be a wrong/invalid input.