Follow-up Comment #3, patch #4492 (project mc): There's more:
Please do not use the FISH_FLAGS to pass the port. It interferes with the other flags. Just use it to indicate a port has been specified and pass that port in a *separate* variable. FISH_DEFAULT_PORT is different for ssh (22) and rsh (514). Even though rsh is probably not used that much any more you should catch that case. The dynamic allocation of the string representing the port doesn't make much sense if it's of a fixed size. Just use a char[6] in that case. vfs_split_url() assures the returned port is within the accept range so you shouldn't have to worry about a buffer overflow. And you don't have to set SUP.port to FISH_DEFAULT_PORT if FISH_FLAG_PORT is not set. Just use 0 as vfs_split_url() also assures an assigned port is larger than 0. This also makes it unnecessary to distinguish between ssh and rsh. Also I think it makes no sense to pass a default_port to vfs_split_url() as one can't know the default_port in before a distinction between rsh and ssh has been made. Unless you move the strncmp for "rsh:" to just before this call, but as I said in the last paragraph it's probably just as easy to leave it to 0. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/patch/?func=detailitem&item_id=4492> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel