From 490108dfe60acdf61705a56c961136b16f9c8950 Mon Sep 17 00:00:00 2001 From: gewlitys Date: Mon, 15 Sep 2003 16:38:04 +0000 Subject: [PATCH] FIxes additional problems found in bug #476, from chmmravatar git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1235 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/comm.c | 2 +- sc2/src/sc2code/libs/sound/sound.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sc2/src/sc2code/comm.c b/sc2/src/sc2code/comm.c index 9c51fa099..30d52e80d 100644 --- a/sc2/src/sc2code/comm.c +++ b/sc2/src/sc2code/comm.c @@ -1705,7 +1705,7 @@ DoCommunication (PENCOUNTER_STATE pES) { temp = curr->tag.data; if (temp == NULL) - break; + continue; // fprintf (stderr, "%s\n", temp); while (wstrlen (temp) > (unsigned int) SUMMARY_CHARS && !(GLOBAL (CurrentActivity) & CHECK_ABORT)) diff --git a/sc2/src/sc2code/libs/sound/sound.c b/sc2/src/sc2code/libs/sound/sound.c index 52a8e2a6b..21ba1b540 100644 --- a/sc2/src/sc2code/libs/sound/sound.c +++ b/sc2/src/sc2code/libs/sound/sound.c @@ -146,14 +146,16 @@ destroy_soundchain (TFB_SoundChain *chain) TFB_SoundChain * get_previous_chain (TFB_SoundChain *first_chain, TFB_SoundChain *current_chain) { - TFB_SoundChain *prev_chain; + TFB_SoundChain *prev_chain, *last_valid = NULL; prev_chain = first_chain; if (prev_chain == current_chain) return (prev_chain); while (prev_chain->next) { - if (prev_chain->next == current_chain || !prev_chain->next->tag.data) - return (prev_chain); + if (prev_chain->tag.type) + last_valid = prev_chain; + if (prev_chain->next == current_chain) + return (last_valid); prev_chain = prev_chain->next; } return (first_chain);