From 3f71d1014254549a8f1411044d64a8990862a673 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Fri, 12 Nov 2010 13:50:38 +0000 Subject: tex4htk compiler warning git-svn-id: svn://tug.org/texlive/trunk@20415 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/tex4htk/ChangeLog | 5 +++++ Build/source/texk/tex4htk/t4ht.c | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Build/source/texk/tex4htk/ChangeLog b/Build/source/texk/tex4htk/ChangeLog index 6c3940c7380..cd97f1cf545 100644 --- a/Build/source/texk/tex4htk/ChangeLog +++ b/Build/source/texk/tex4htk/ChangeLog @@ -1,3 +1,8 @@ +2010-11-12 Peter Breitenlohner + + * t4ht.c (filterGifScript): Avoid 'filtered_script might be used + uninitialized'. Use NULL_SCRIPT. + 2010-02-23 Peter Breitenlohner * t4ht.c (get_env_dir0 [WIN32]: Declare as static. diff --git a/Build/source/texk/tex4htk/t4ht.c b/Build/source/texk/tex4htk/t4ht.c index 37db830fe66..cb5091404eb 100644 --- a/Build/source/texk/tex4htk/t4ht.c +++ b/Build/source/texk/tex4htk/t4ht.c @@ -744,22 +744,22 @@ static struct script_struct * filterGifScript *old_script, *new_script; Q_CHAR *command, *ext; - if( script == (struct script_struct *) 0 ){ - return (struct script_struct *) 0; - } + filtered_script = NULL_SCRIPT; + if( script == NULL_SCRIPT ) + return filtered_script; old_script = script; command = old_script->command; if( *command != '.' ){ -new_script = (struct script_struct *) 0; -while( old_script != (struct script_struct *) 0 ){ +new_script = NULL_SCRIPT; +while( old_script != NULL_SCRIPT ){ command = old_script->command; if( *command == '.' ){ return filtered_script; } scr = (struct script_struct *) m_alloc(struct script_struct, (int) 1); scr->command = old_script->command; - scr->next = (struct script_struct *) 0; - if( new_script == (struct script_struct *) 0 ){ + scr->next = NULL_SCRIPT; + if( new_script == NULL_SCRIPT ){ filtered_script = new_script = scr; } else { new_script = new_script->next = scr; @@ -778,8 +778,8 @@ while( (*ext != '.') && (ext != file) ){ ext--; } while( TRUE ){ - if( old_script == (struct script_struct *) 0 ){ - return (struct script_struct *) 0; + if( old_script == NULL_SCRIPT ){ + return NULL_SCRIPT; } command = old_script->command; if(*command != '.') { @@ -792,15 +792,15 @@ while( TRUE ){ } } -new_script = (struct script_struct *) 0; -while( old_script != (struct script_struct *) 0 ){ +new_script = NULL_SCRIPT; +while( old_script != NULL_SCRIPT ){ command = old_script->command; if( *command == '.' ){ return filtered_script; } scr = (struct script_struct *) m_alloc(struct script_struct, (int) 1); scr->command = old_script->command; - scr->next = (struct script_struct *) 0; - if( new_script == (struct script_struct *) 0 ){ + scr->next = NULL_SCRIPT; + if( new_script == NULL_SCRIPT ){ filtered_script = new_script = scr; } else { new_script = new_script->next = scr; @@ -833,7 +833,7 @@ void free_script #endif { struct script_struct *temp; - while( script != (struct script_struct *) 0 ){ + while( script != NULL_SCRIPT ){ temp = script; script = script->next; free( temp ); -- cgit v1.2.3