fecdec: Minor cleanups.
[paraslash.git] / command.c
index 988eae6..b59fae7 100644 (file)
--- a/command.c
+++ b/command.c
@@ -204,17 +204,9 @@ static int check_sender_args(int argc, char * const * argv, struct sender_comman
                break;
        case SENDER_ADD:
        case SENDER_DELETE:
-               if (argc != 4 && argc != 5)
-                       return -E_COMMAND_SYNTAX;
-               if (!inet_pton(AF_INET, argv[3], &scd->addr))
+               if (argc != 4)
                        return -E_COMMAND_SYNTAX;
-               scd->port = -1;
-               if (argc == 5) {
-                       scd->port = atoi(argv[4]);
-                       if (scd->port < 0 || scd->port > 65535)
-                               return -E_COMMAND_SYNTAX;
-               }
-               break;
+               return parse_fec_url(argv[3], scd);
        default:
                return -E_COMMAND_SYNTAX;
        }