From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Marek Lindner Date: Wed, 30 Jun 2010 21:35:49 +0200 References: <1277920995-25503-1-git-send-email-linus.luessing@web.de> In-Reply-To: <1277920995-25503-1-git-send-email-linus.luessing@web.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201006302135.50499.lindner_marek@yahoo.de> Subject: Re: [B.A.T.M.A.N.] [PATCH] batctl: Add timeout filtering option for originators Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: The list for a Better Approach To Mobile Ad-hoc Networking On Wednesday 30 June 2010 20:03:13 Linus L=C3=BCssing wrote: > + char msecs_buff[4]; > + memset(msecs_buff, '0', sizeof(msecs_buff)); > + msecs_buff[3] =3D '\0'; Shouldn't a simple=20 memset(msecs_buff, 0, sizeof(msecs_buff)); be enough ? > + if (sscanf(optarg, "%3d.%3s", &orig_timeout_secs, > + else if (sscanf(optarg, "%3d", &orig_timeout_secs) =3D=3D 1) { ; } > + else { I don't quite understand the sense of the "else if" here. You could also=20 write: else if (sscanf(optarg, "%3d", &orig_timeout_secs) !=3D 1) and write no else block but I don't see why 1 second should be accepted and= =20 nothing else ? Regards, Marek