### Function

# FwupdPlugin strdup

#### Declaration [src]

    GString*
    fu_strdup (
      const gchar* str,
      gsize bufsz,
      gsize offset
    )

#### Description [src]

Copies a string from a buffer of a specified size up to (but not including) `NUL`.

Available since: | 1.8.11

#### Parameters

`str` | `const gchar*`
| A string, e.g. `test`
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.
`bufsz` | `gsize`
| The maximum size of `str`.
`offset` | `gsize`
| The offset to start copying from.

#### Return value

Returns: | `GString`
| A `GString`, possibly of zero size.
| The caller of the function takes ownership of the data, and is responsible for freeing it.