Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/usp10/bidi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/usp10/bidi.c b/dlls/usp10/bidi.c index 8f94ede..2277190 100644 --- a/dlls/usp10/bidi.c +++ b/dlls/usp10/bidi.c @@ -692,8 +692,8 @@ static BracketPair *computeBracketPairs(IsolatedRun *iso_run) WCHAR *open_stack; int *stack_index; int stack_top = iso_run->length; + unsigned int pair_count = 0; BracketPair *out = NULL; - int pair_count = 0; int i;
open_stack = heap_alloc(iso_run->length * sizeof(*open_stack)); @@ -745,13 +745,13 @@ static BracketPair *computeBracketPairs(IsolatedRun *iso_run) heap_free(open_stack); heap_free(stack_index);
- if (pair_count == 0) + if (!pair_count) { heap_free(out); - out = NULL; + return NULL; } - else if (pair_count > 1) - qsort(out, pair_count, sizeof(BracketPair), compr); + + qsort(out, pair_count, sizeof(*out), compr);
return out; }
Signed-off-by: Aric Stewart aric@codeweavers.com
On 2/20/18 12:33 AM, Henri Verbeet wrote:
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
dlls/usp10/bidi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/usp10/bidi.c b/dlls/usp10/bidi.c index 8f94ede..2277190 100644 --- a/dlls/usp10/bidi.c +++ b/dlls/usp10/bidi.c @@ -692,8 +692,8 @@ static BracketPair *computeBracketPairs(IsolatedRun *iso_run) WCHAR *open_stack; int *stack_index; int stack_top = iso_run->length;
- unsigned int pair_count = 0; BracketPair *out = NULL;
int pair_count = 0; int i;
open_stack = heap_alloc(iso_run->length * sizeof(*open_stack));
@@ -745,13 +745,13 @@ static BracketPair *computeBracketPairs(IsolatedRun *iso_run) heap_free(open_stack); heap_free(stack_index);
- if (pair_count == 0)
- if (!pair_count) { heap_free(out);
out = NULL;
return NULL; }
- else if (pair_count > 1)
qsort(out, pair_count, sizeof(BracketPair), compr);
qsort(out, pair_count, sizeof(*out), compr);
return out; }