diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2023-01-26 10:34:26 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2023-01-26 10:34:26 +0100 |
commit | dd24fa3063e29eb9308eebb3e3471e8fd3fd5ef7 (patch) | |
tree | 479d0b186b75361bb714a10ca8b080a35e176f6d /storage/connect/json.cpp | |
parent | 765291d63e0c2a10c513a354e9ecb2e905570775 (diff) | |
parent | 2279dddad6bea00c5774a76f410c11fd56ad168f (diff) | |
download | mariadb-git-dd24fa3063e29eb9308eebb3e3471e8fd3fd5ef7.tar.gz |
Merge branch '10.3' into 10.4
Diffstat (limited to 'storage/connect/json.cpp')
-rw-r--r-- | storage/connect/json.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/storage/connect/json.cpp b/storage/connect/json.cpp index c37c4955607..6b1da3af628 100644 --- a/storage/connect/json.cpp +++ b/storage/connect/json.cpp @@ -10,6 +10,7 @@ /* Include relevant sections of the MariaDB header file. */ /***********************************************************************/ #include <my_global.h> +#include <m_string.h> /***********************************************************************/ /* Include application header files: */ @@ -270,7 +271,7 @@ PSZ Serialize(PGLOBAL g, PJSON jsp, char* fn, int pretty) { jdp->dfp = GetDefaultPrec(); if (!jsp) { - strcpy(g->Message, "Null json tree"); + safe_strcpy(g->Message, sizeof(g->Message), "Null json tree"); throw 1; } else if (!fn) { // Serialize to a string @@ -278,9 +279,8 @@ PSZ Serialize(PGLOBAL g, PJSON jsp, char* fn, int pretty) { b = pretty == 1; } else { if (!(fs = fopen(fn, "wb"))) { - snprintf(g->Message, sizeof(g->Message), MSG(OPEN_MODE_ERROR), - "w", (int)errno, fn); - strcat(strcat(g->Message, ": "), strerror(errno)); + snprintf(g->Message, sizeof(g->Message), MSG(OPEN_MODE_ERROR) ": %s", + "w", (int)errno, fn, strerror(errno)); throw 2; } else if (pretty >= 2) { // Serialize to a pretty file |