### Function

# FwupdPlugin strsafe

since: 1.8.2

#### Declaration [src]

    gchar*
    fu_strsafe (
      const gchar* str,
      gsize maxsz
    )

#### Description [src]

Converts a string into something that can be safely printed.

Available since: 1.8.2

#### Parameters

`str`

  Type: `const gchar*`

  A string to make safe for printing.

  The argument can be `NULL`.
  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`maxsz`

  Type: `gsize`

  Maximum size of returned string, or `G_MAXSIZE` for no limit.

#### Return value

Type: `gchar*`

Safe string, or `NULL` if there was nothing valid.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.