1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

cleanup: move safe_str*() from sql_acl.cc to m_string.h

This commit is contained in:
Sergei Golubchik
2014-08-28 20:07:27 +02:00
parent 9bd5d54c11
commit 99677cc510
3 changed files with 15 additions and 14 deletions

View File

@@ -239,4 +239,15 @@ static inline void lex_string_set(LEX_STRING *lex_str, const char *c_str)
lex_str->length= strlen(c_str);
}
#ifdef __cplusplus
static inline char *safe_str(char *str)
{ return str ? str : const_cast<char*>(""); }
#endif
static inline const char *safe_str(const char *str)
{ return str ? str : ""; }
static inline size_t safe_strlen(const char *str)
{ return str ? strlen(str) : 0; }
#endif