fix password issue

getopt should be used with strcpy, or each optarg will be overriden.

I didn't fix other args, you may check them as well.