All of lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batctl: optchar variable uses wrong type
@ 2016-09-15  8:41 Andreas Pape
  2016-09-15  9:25 ` Sven Eckelmann
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andreas Pape @ 2016-09-15  8:41 UTC (permalink / raw)
  To: b.a.t.m.a.n

The variable "optchar" used char instead of int leading to a non
working batctl tp command as the while loop parsing the tp
arguments with the getopt command is only left via the "default"
case leaving the tp subcommand unusable. Using type char also
lead to a compiler warning.

Signed-off-by: Andreas Pape <apape@phoenixcontact.com>
---
 tp_meter.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tp_meter.c b/tp_meter.c
index 7fe0d56..10dc2b9 100644
--- a/tp_meter.c
+++ b/tp_meter.c
@@ -395,7 +395,7 @@ int tp_meter(char *mesh_iface, int argc, char **argv)
 	int ret = EXIT_FAILURE;
 	int found_args = 1, read_opt = USE_BAT_HOSTS;
 	uint32_t time = 0;
-	char optchar;
+	int optchar;
 	struct nl_sock *listen_sock = NULL;
 	struct tp_result result = {
 		.error = 0,
--
1.7.0.4



..................................................................
PHOENIX CONTACT ELECTRONICS GmbH

Sitz der Gesellschaft / registered office of the company: 31812 Bad Pyrmont
USt-Id-Nr.: DE811742156
Amtsgericht Hannover HRB 100528 / district court Hannover HRB 100528
Geschäftsführer / Executive Board: Ulrich Leidecker, Christoph Leifer
__________________________________________________________________
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren, jegliche anderweitige Verwendung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
----------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
___________________________________________________________________

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batctl: optchar variable uses wrong type
  2016-09-15  8:41 [B.A.T.M.A.N.] [PATCH] batctl: optchar variable uses wrong type Andreas Pape
@ 2016-09-15  9:25 ` Sven Eckelmann
  2016-09-15 12:02 ` [B.A.T.M.A.N.] Donations for domain registration fees open-mesh.net/open-mesh.org elektra
  2016-10-18 12:30 ` [B.A.T.M.A.N.] batctl: optchar variable uses wrong type Sven Eckelmann
  2 siblings, 0 replies; 6+ messages in thread
From: Sven Eckelmann @ 2016-09-15  9:25 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]

On Donnerstag, 15. September 2016 10:41:00 CEST Andreas Pape wrote:
> The variable "optchar" used char instead of int leading to a non
> working batctl tp command as the while loop parsing the tp
> arguments with the getopt command is only left via the "default"
> case leaving the tp subcommand unusable. Using type char also
> lead to a compiler warning.

I find the commit message extreme confusing. It think you wanted to describe 
following problem:

* some platform C ABIs define char as unsigned
* getopt can return negative values
* the loop "around" getopt waits for a negative value to stop (which never
  happens with an unsigned char)

But the code change itself looks good.

Reviewed-by: Sven Eckelmann <sven@narfation.org>

Kind regards,
	Sven

> ---
>  tp_meter.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tp_meter.c b/tp_meter.c
> index 7fe0d56..10dc2b9 100644
> --- a/tp_meter.c
> +++ b/tp_meter.c
> @@ -395,7 +395,7 @@ int tp_meter(char *mesh_iface, int argc, char **argv)
>  	int ret = EXIT_FAILURE;
>  	int found_args = 1, read_opt = USE_BAT_HOSTS;
>  	uint32_t time = 0;
> -	char optchar;
> +	int optchar;
>  	struct nl_sock *listen_sock = NULL;
>  	struct tp_result result = {
>  		.error = 0,


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [B.A.T.M.A.N.] Donations for domain registration fees open-mesh.net/open-mesh.org
  2016-09-15  8:41 [B.A.T.M.A.N.] [PATCH] batctl: optchar variable uses wrong type Andreas Pape
  2016-09-15  9:25 ` Sven Eckelmann
@ 2016-09-15 12:02 ` elektra
  2016-09-15 12:30   ` Sven Eckelmann
  2016-10-18 12:30 ` [B.A.T.M.A.N.] batctl: optchar variable uses wrong type Sven Eckelmann
  2 siblings, 1 reply; 6+ messages in thread
From: elektra @ 2016-09-15 12:02 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

Hi all –

since the beginning of the open-mesh development platform Axel Neumann and I have been paying the domain registration fees for open-mesh.net and open-mesh.org. Since Axel went on to work for bmx as a seperate project a few years ago, I'm paying the fees every year out of my pocket.

This year I'm on a tight budget. So if anyone wants to throw in a coin or two to share the costs, this would be appreciated. The amount due this year is around 39 Euro.

If you want to donate, drop me a personal e-mail.

Cheers,
Elektra


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] Donations for domain registration fees open-mesh.net/open-mesh.org
  2016-09-15 12:02 ` [B.A.T.M.A.N.] Donations for domain registration fees open-mesh.net/open-mesh.org elektra
@ 2016-09-15 12:30   ` Sven Eckelmann
  2016-09-15 12:59     ` Simon Wunderlich
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Eckelmann @ 2016-09-15 12:30 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

On Donnerstag, 15. September 2016 14:02:13 CEST elektra wrote:
> Hi all –

Please don't hijack other threads ;)

[...]
> This year I'm on a tight budget. So if anyone wants to throw in a coin or
> two to share the costs, this would be appreciated. The amount due this year
> is around 39 Euro.

I personally would pay for the open-mesh.org address. I will send you a 
private mail to discuss the transfer.

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] Donations for domain registration fees open-mesh.net/open-mesh.org
  2016-09-15 12:30   ` Sven Eckelmann
@ 2016-09-15 12:59     ` Simon Wunderlich
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Wunderlich @ 2016-09-15 12:59 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

Hi,

On Thursday, September 15, 2016 2:30:20 PM CEST Sven Eckelmann wrote:
> On Donnerstag, 15. September 2016 14:02:13 CEST elektra wrote:
> > Hi all –
> 
> Please don't hijack other threads ;)
> 
> [...]
> 
> > This year I'm on a tight budget. So if anyone wants to throw in a coin or
> > two to share the costs, this would be appreciated. The amount due this
> > year
> > is around 39 Euro.
> 
> I personally would pay for the open-mesh.org address. I will send you a
> private mail to discuss the transfer.

I can also help out.

Do we still need the .net domain? I think we are primarily using open-mesh.org 
anyway, and having two domains doesn't really help (and costs money ;]).

What do you think?

Cheers,
     Simon

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] batctl: optchar variable uses wrong type
  2016-09-15  8:41 [B.A.T.M.A.N.] [PATCH] batctl: optchar variable uses wrong type Andreas Pape
  2016-09-15  9:25 ` Sven Eckelmann
  2016-09-15 12:02 ` [B.A.T.M.A.N.] Donations for domain registration fees open-mesh.net/open-mesh.org elektra
@ 2016-10-18 12:30 ` Sven Eckelmann
  2 siblings, 0 replies; 6+ messages in thread
From: Sven Eckelmann @ 2016-10-18 12:30 UTC (permalink / raw)
  To: Andreas Pape; +Cc: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 799 bytes --]

On Donnerstag, 15. September 2016 10:41:00 CEST Andreas Pape wrote:
> The variable "optchar" used char instead of int leading to a non
> working batctl tp command as the while loop parsing the tp
> arguments with the getopt command is only left via the "default"
> case leaving the tp subcommand unusable. Using type char also
> lead to a compiler warning.
> 
> Signed-off-by: Andreas Pape <apape@phoenixcontact.com>
> Reviewed-by: Sven Eckelmann <sven@narfation.org>
> ---
>  tp_meter.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied in e397137aa9f4417ec21b4ba3db59b4f4e55b72fd [1]. The commit messages
was slightly modified to (hopefully) make it more readable.

Kind regards,
	Sven

[1] https://git.open-mesh.org/batctl.git/commit/e397137aa9f4417ec21b4ba3db59b4f4e55b72fd

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-18 12:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15  8:41 [B.A.T.M.A.N.] [PATCH] batctl: optchar variable uses wrong type Andreas Pape
2016-09-15  9:25 ` Sven Eckelmann
2016-09-15 12:02 ` [B.A.T.M.A.N.] Donations for domain registration fees open-mesh.net/open-mesh.org elektra
2016-09-15 12:30   ` Sven Eckelmann
2016-09-15 12:59     ` Simon Wunderlich
2016-10-18 12:30 ` [B.A.T.M.A.N.] batctl: optchar variable uses wrong type Sven Eckelmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.