const char * myqttd_ensure_str ( const char *  string)

Ensure having a printable string from the provided reference.

In the case is NULL an empty string is reported. The function is useful for printing or debuging to avoid sending NULL values to certain functions that aren't able to handle them.

Parameters
stringThe string to ensure it is defined.
Returns
The same string if it is defined and has content otherwise empty string is reported.