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:
@@ -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
|
||||
|
Reference in New Issue
Block a user