From: Alan Modra Date: Sun, 18 Oct 2009 23:12:50 +0000 (+0000) Subject: PR binutils/10792 X-Git-Tag: binutils-2_20_1~194 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=65bad124fe2d3b18591b4fe81cabd14f8517044e;p=thirdparty%2Fbinutils-gdb.git PR binutils/10792 * dlltool.c (dll_name_list_append): Declare variable at start of block. (dll_name_list_count, dll_name-list_print): Likewise. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index bee7b357176..ae7d5e45f74 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,10 @@ +2009-10-19 Jerker Bäck + + PR binutils/10792 + * dlltool.c (dll_name_list_append): Declare variable at start + of block. + (dll_name_list_count, dll_name-list_print): Likewise. + 2009-10-01 Alan Modra * addr2line.c (slurp_symtab): Don't use bfd_read_minisymbols. diff --git a/binutils/dlltool.c b/binutils/dlltool.c index 71fd9932c3e..897790d9e10 100644 --- a/binutils/dlltool.c +++ b/binutils/dlltool.c @@ -3162,13 +3162,15 @@ gen_lib_file (int delay) static void dll_name_list_append (dll_name_list_type * list, bfd_byte * data) { + dll_name_list_node_type * entry; + /* Error checking. */ if (! list || ! list->tail) return; /* Allocate new node. */ - dll_name_list_node_type * entry = - (dll_name_list_node_type *) xmalloc (sizeof (dll_name_list_node_type)); + entry = ((dll_name_list_node_type *) + xmalloc (sizeof (dll_name_list_node_type))); /* Initialize its values. */ entry->dllname = xstrdup ((char *) data); @@ -3184,12 +3186,14 @@ dll_name_list_append (dll_name_list_type * list, bfd_byte * data) static int dll_name_list_count (dll_name_list_type * list) { + dll_name_list_node_type * p; + int count = 0; + /* Error checking. */ if (! list || ! list->head) return 0; - int count = 0; - dll_name_list_node_type * p = list->head; + p = list->head; while (p && p->next) { @@ -3204,11 +3208,13 @@ dll_name_list_count (dll_name_list_type * list) static void dll_name_list_print (dll_name_list_type * list) { + dll_name_list_node_type * p; + /* Error checking. */ if (! list || ! list->head) return; - dll_name_list_node_type * p = list->head; + p = list->head; while (p && p->next && p->next->dllname && *(p->next->dllname)) {