1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Stability fixes (thanks valgrind).

[originally from svn r4916]
This commit is contained in:
Simon Tatham 2004-11-28 09:32:17 +00:00
parent 569da2eb7b
commit cdbb891f0f

View File

@ -1,5 +1,5 @@
/************************************************************************ /************************************************************************
* $Id: minibidi.c,v 1.1 2004/05/22 10:36:50 simon Exp $ * $Id$
* *
* ------------ * ------------
* Description: * Description:
@ -14,9 +14,9 @@
* ----------------- * -----------------
* Revision Details: (Updated by Revision Control System) * Revision Details: (Updated by Revision Control System)
* ----------------- * -----------------
* $Date: 2004/05/22 10:36:50 $ * $Date$
* $Author: simon $ * $Author$
* $Revision: 1.1 $ * $Revision$
* $Source: /u1/simon/svn-migration/cvs/putty/minibidi.c,v $ * $Source: /u1/simon/svn-migration/cvs/putty/minibidi.c,v $
* *
* (www.arabeyes.org - under MIT license) * (www.arabeyes.org - under MIT license)
@ -55,7 +55,7 @@ void flipThisRun(bidi_char *from, unsigned char *level, int max, int count)
tlevel = max; tlevel = max;
i = j = findIndexOfRun(level, i, count, max); i = j = findIndexOfRun(level, i, count, max);
/* find the end of the run */ /* find the end of the run */
while(tlevel <= level[i] && i<count) while(i<count && tlevel <= level[i])
{ {
i++; i++;
} }
@ -711,7 +711,8 @@ int do_bidi(bidi_char *line, int count)
{ {
j++; j++;
} }
if(getType(line[j].wc) == B || getType(line[j].wc) == S) if(j==count || getType(line[j].wc) == B ||
getType(line[j].wc) == S)
{ {
for(j--; j>=i ; j--) for(j--; j>=i ; j--)
{ {