qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Ross (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (PROTON-1559) Typo in some proactor examples
Date Thu, 28 Sep 2017 15:32:01 GMT

     [ https://issues.apache.org/jira/browse/PROTON-1559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Justin Ross reassigned PROTON-1559:
-----------------------------------

    Assignee: Justin Ross

> Typo in some proactor examples
> ------------------------------
>
>                 Key: PROTON-1559
>                 URL: https://issues.apache.org/jira/browse/PROTON-1559
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: examples, proton-c
>    Affects Versions: proton-c-0.18.0
>            Reporter: Jiri Daněk
>            Assignee: Justin Ross
>            Priority: Minor
>
> Some proactor examples have a typo in the code that reads CLI options. It does not seem
to have effect on functionality, because the {{argv[argc]}} element is always a NULL.
> {code}
> diff --git a/examples/c/proactor/direct.c b/examples/c/proactor/direct.c
> index 15550e6b..d33010f0 100644
> --- a/examples/c/proactor/direct.c
> +++ b/examples/c/proactor/direct.c
> @@ -308,8 +308,8 @@ int main(int argc, char **argv) {
>    struct app_data_t app = {0};
>    int i = 0;
>    app.container_id = argv[i++];   /* Should be unique */
> -  app.host = (argc > 1) ? argv[i++] : "";
> -  app.port = (argc > 1) ? argv[i++] : "amqp";
> +  app.host = (argc > i) ? argv[i++] : "";
> +  app.port = (argc > i) ? argv[i++] : "amqp";
>    app.amqp_address = (argc > i) ? argv[i++] : "examples";
>    app.message_count = (argc > i) ? atoi(argv[i++]) : 10;
>  
> diff --git a/examples/c/proactor/receive.c b/examples/c/proactor/receive.c
> index 6fd74a51..3f059f56 100644
> --- a/examples/c/proactor/receive.c
> +++ b/examples/c/proactor/receive.c
> @@ -172,8 +172,8 @@ int main(int argc, char **argv) {
>    struct app_data_t app = {0};
>    int i = 0;
>    app.container_id = argv[i++];   /* Should be unique */
> -  app.host = (argc > 1) ? argv[i++] : "";
> -  app.port = (argc > 1) ? argv[i++] : "amqp";
> +  app.host = (argc > i) ? argv[i++] : "";
> +  app.port = (argc > i) ? argv[i++] : "amqp";
>    app.amqp_address = (argc > i) ? argv[i++] : "examples";
>    app.message_count = (argc > i) ? atoi(argv[i++]) : 10;
>  
> diff --git a/examples/c/proactor/send.c b/examples/c/proactor/send.c
> index 43da8b04..a80fbcb5 100644
> --- a/examples/c/proactor/send.c
> +++ b/examples/c/proactor/send.c
> @@ -180,8 +180,8 @@ int main(int argc, char **argv) {
>    struct app_data_t app = {0};
>    int i = 0;
>    app.container_id = argv[i++];   /* Should be unique */
> -  app.host = (argc > 1) ? argv[i++] : "";
> -  app.port = (argc > 1) ? argv[i++] : "amqp";
> +  app.host = (argc > i) ? argv[i++] : "";
> +  app.port = (argc > i) ? argv[i++] : "amqp";
>    app.amqp_address = (argc > i) ? argv[i++] : "examples";
>    app.message_count = (argc > i) ? atoi(argv[i++]) : 10;
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message