VirtualBox

Changeset 33489 in vbox for trunk


Ignore:
Timestamp:
Oct 27, 2010 10:31:41 AM (14 years ago)
Author:
vboxsync
Message:

VBoxManage: simplification, loop was nonsense

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp

    r32701 r33489  
    279279int handleDHCPServer(HandlerArg *a)
    280280{
    281     int result = 0;
    282281    if (a->argc < 1)
    283282        return errorSyntax(USAGE_DHCPSERVER, "Not enough parameters");
    284283
    285     for (int i = 0; i < a->argc; i++)
    286     {
    287         if (strcmp(a->argv[i], "modify") == 0)
    288         {
    289             int cProcessed;
    290             result = handleOp(a, OP_MODIFY, i+1, &cProcessed);
    291             break;
    292         }
    293         else if (strcmp(a->argv[i], "add") == 0)
    294         {
    295             int cProcessed;
    296             result = handleOp(a, OP_ADD, i+1, &cProcessed);
    297             break;
    298         }
    299         else if (strcmp(a->argv[i], "remove") == 0)
    300         {
    301             int cProcessed;
    302             result = handleOp(a, OP_REMOVE, i+1, &cProcessed);
    303             break;
    304         }
    305         else
    306         {
    307             result = errorSyntax(USAGE_DHCPSERVER, "Invalid parameter '%s'", Utf8Str(a->argv[i]).c_str());
    308             break;
    309         }
    310     }
     284    int result;
     285    int cProcessed;
     286    if (strcmp(a->argv[0], "modify") == 0)
     287        result = handleOp(a, OP_MODIFY, 1, &cProcessed);
     288    else if (strcmp(a->argv[0], "add") == 0)
     289        result = handleOp(a, OP_ADD, 1, &cProcessed);
     290    else if (strcmp(a->argv[0], "remove") == 0)
     291        result = handleOp(a, OP_REMOVE, 1, &cProcessed);
     292    else
     293        result = errorSyntax(USAGE_DHCPSERVER, "Invalid parameter '%s'", Utf8Str(a->argv[0]).c_str());
    311294
    312295    return result;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette