Commit 5659336a authored by Rom Walton's avatar Rom Walton

- log: Fix a parameter parsing bug, hazards of copy/paste/fix-up I

        suppose.  Increment the index before use instead of just adding
        1.  Next iteration through the main loop will then pick-up
        new parameter instead of the value for the previously
        processed command. Parameter parsing 101.
        
    client/
        boinc_log.cpp

svn path=/trunk/boinc/; revision=19700
parent dff233f5
......@@ -9487,3 +9487,13 @@ Rom 24 Nov 2009
client/
boinc_log.cpp
Rom 24 Nov 2009
- log: Fix a parameter parsing bug, hazards of copy/paste/fix-up I
suppose. Increment the index before use instead of just adding
1. Next iteration through the main loop will then pick-up
new parameter instead of the value for the previously
processed command. Parameter parsing 101.
client/
boinc_log.cpp
......@@ -154,7 +154,7 @@ int main(int argc, char** argv) {
} else if (ARG(host)) {
if ((i+1) == (unsigned int)argc) usage();
hostname = hostname_buf;
safe_strcpy(hostname_buf, argv[i+1]);
safe_strcpy(hostname_buf, argv[++i]);
p = strchr(hostname, ':');
if (p) {
port = atoi(p+1);
......@@ -162,10 +162,10 @@ int main(int argc, char** argv) {
}
} else if (ARG(passwd)) {
if ((i+1) == (unsigned int)argc) usage();
safe_strcpy(passwd_buf, argv[i+1]);
safe_strcpy(passwd_buf, argv[++i]);
} else if (ARG(datadir)) {
if ((i+1) == (unsigned int)argc) usage();
safe_strcpy(datadir, argv[i+1]);
safe_strcpy(datadir, argv[++i]);
} else {
printf("Unknown option: %s\n", argv[i]);
usage();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment