[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 09/28] ddb/db_aout.c (aout_db_is_filename): remove unnecessar
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 09/28] ddb/db_aout.c (aout_db_is_filename): remove unnecessary check |
Date: |
Mon, 9 Dec 2013 00:49:36 +0900 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Marin Ramesa, le Sun 08 Dec 2013 12:40:11 +0100, a écrit :
> First loop iteration ensures that the value is non-zero. Second loop iteration
> likewise. Therefore name[1] is always non-zero if the loop is executed.
Uh? It seems wrong to me. Please show a precise variable evolution shart.
> * ddb/db_aout.c (aout_db_is_filename): Remove unnecessary check.
>
> ---
> ddb/db_aout.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/ddb/db_aout.c b/ddb/db_aout.c
> index 63fa518..9a018a6 100644
> --- a/ddb/db_aout.c
> +++ b/ddb/db_aout.c
> @@ -135,10 +135,8 @@ aout_db_is_filename(name)
> char *name;
> {
> while (*name) {
> - if (*name == '.') {
> - if (name[1])
> - return(TRUE);
> - }
> + if (*name == '.')
> + return(TRUE);
> name++;
> }
> return(FALSE);
> --
> 1.8.1.4
>
>
--
Samuel
"c'est pas nous qui sommes à la rue, c'est la rue qui est à nous"
- Re: [PATCH 06/28] i386/i386/db_interface.c (db_write_bytes): simplify code, (continued)
[PATCH 05/28] i386/i386/db_interface.c: remove forward declaration, Marin Ramesa, 2013/12/08
[PATCH 07/28] ddb/db_aout.c (aout_db_sym_init): remove unnecessary variable, Marin Ramesa, 2013/12/08
[PATCH 08/28] ddb/db_aout.c (aout_db_eq_name): remove unnecessary variable, Marin Ramesa, 2013/12/08
[PATCH 09/28] ddb/db_aout.c (aout_db_is_filename): remove unnecessary check, Marin Ramesa, 2013/12/08
- Re: [PATCH 09/28] ddb/db_aout.c (aout_db_is_filename): remove unnecessary check,
Samuel Thibault <=
[PATCH 10/28] ddb/db_aout.c (aout_db_qualified_search): use DB_SYM_NULL as return value, Marin Ramesa, 2013/12/08
[PATCH 11/28] ddb/db_aout.c (aout_db_lookup): remove forward declaration, Marin Ramesa, 2013/12/08
[PATCH 12/28] ddb/db_break.c (db_add_thread_breakpoint): fix argument list, Marin Ramesa, 2013/12/08
[PATCH 13/28] ddb/db_break.c (db_find_thread_breakpoint_here): remove unnecessary cast, Marin Ramesa, 2013/12/08
[PATCH 14/28] i386/i386at/kd.c: use io_req instead of uio, Marin Ramesa, 2013/12/08
[PATCH 15/28] ddb/db_command.c: use boolean values, Marin Ramesa, 2013/12/08
[PATCH 16/28] ddb/db_command.c (db_command): use db_addr_t instead of db_expr_t, Marin Ramesa, 2013/12/08
[PATCH 17/28] ddb/db_command.c (db_command): remove forward declaration, Marin Ramesa, 2013/12/08