[hackers] [libgrapheme] Only copy current reorder into test if it is not NULL in bidi-testgen || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Sun, 13 Nov 2022 09:16:23 +0100 (CET)

commit be3430ca6b7d275d3691f126ad65e84d732ebbb1
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Sun Nov 13 09:15:33 2022 +0100
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Sun Nov 13 09:15:33 2022 +0100

    Only copy current reorder into test if it is not NULL in bidi-testgen
    
    Signed-off-by: Laslo Hunhold <dev_AT_frign.de>

diff --git a/gen/bidirectional-test.c b/gen/bidirectional-test.c
index 3034564..848db7b 100644
--- a/gen/bidirectional-test.c
+++ b/gen/bidirectional-test.c
_AT_@ -333,7 +333,10 @@ test_callback(const char *file, char **field, size_t nfields,
                         fprintf(stderr, "calloc: %s\n", strerror(errno));
                         exit(1);
                 }
- memcpy(test[testlen - 1].reorder, current_reorder, current_reorder_len * sizeof(*(test[testlen - 1].reorder)));
+ if (current_reorder != NULL) {
+ memcpy(test[testlen - 1].reorder, current_reorder,
+ current_reorder_len * sizeof(*(test[testlen - 1].reorder)));
+ }
                 test[testlen - 1].reorderlen = current_reorder_len;
         
                 if (current_level_len != test[testlen - 1].cplen) {
Received on Sun Nov 13 2022 - 09:16:23 CET

This archive was generated by hypermail 2.3.0 : Sun Nov 13 2022 - 09:24:33 CET