summaryrefslogtreecommitdiff
path: root/strings/ctype-tis620.c
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-02 15:48:47 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-02 15:48:47 +0200
commitc7f322c91faf97a9f758c288b38e1385fd89b32d (patch)
treecf2a4cf562acffdf5b4b96d84e34f29c7f428458 /strings/ctype-tis620.c
parentd5ce7824444b7491f420061076ae5087d4829428 (diff)
parent8036d0a3590dddf4d51ba02bc74ba3a5a96674f7 (diff)
downloadmariadb-git-c7f322c91faf97a9f758c288b38e1385fd89b32d.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'strings/ctype-tis620.c')
-rw-r--r--strings/ctype-tis620.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index cbf50c638fd..afc5771d6c5 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -553,9 +553,11 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)),
alloced= a= (uchar*) my_malloc(a_length+b_length+2, MYF(MY_FAE));
b= a + a_length+1;
- memcpy((char*) a, (char*) a0, a_length);
+ if (a_length)
+ memcpy((char*) a, (char*) a0, a_length);
a[a_length]= 0; /* if length(a0)> len1, need to put 'end of string' */
- memcpy((char *)b, (char *)b0, b_length);
+ if (b_length)
+ memcpy((char *)b, (char *)b0, b_length);
b[b_length]= 0; /* put end of string */
a_length= thai2sortable(a, a_length);
b_length= thai2sortable(b, b_length);