[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Uninitialized variable
From: |
Vladimir 'φ-coder/phcoder' Serbinenko |
Subject: |
Re: [PATCH] Uninitialized variable |
Date: |
Fri, 24 Sep 2010 00:39:49 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100805 Icedove/3.0.6 |
On 09/23/2010 06:53 PM, Grégoire Sutre wrote:
> Hi,
>
> This is catched (as a warning) by gcc 4.1.3 -- gcc 4.4 does not
> complain (maybe some command-line option is missing?).
>
> Grégoire
>
>
> 2010-09-23 Grégoire Sutre <address@hidden>
>
> * grub-core/commands/acpihalt.c (get_sleep_type): Initialize prev.
>
> === modified file 'grub-core/commands/acpihalt.c'
> --- grub-core/commands/acpihalt.c 2010-09-13 18:29:15 +0000
> +++ grub-core/commands/acpihalt.c 2010-09-23 13:23:46 +0000
> @@ -134,11 +134,11 @@ skip_ext_op (const grub_uint8_t *ptr, co
> }
>
> static int
> get_sleep_type (grub_uint8_t *table, grub_uint8_t *end)
> {
> - grub_uint8_t *ptr, *prev;
> + grub_uint8_t *ptr, *prev = 0;
> int sleep_type = -1;
>
It should be prev = table; Other than that go ahead.
> ptr = table + sizeof (struct grub_acpi_table_header);
> while (ptr < end && prev < ptr)
> {
>
>
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
signature.asc
Description: OpenPGP digital signature