---
name: "ms_strncpopen"
section: "3"
platform: "linux"
package: "libmseed-doc"
version: "2.19.8-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ms_strncpopen"
---

# ms\_strncpopen(3)

Non-standard string copying

## NAME

ms\_strncpclean - Non-standard string copying

## SYNOPSIS

```
#include <libmseed.h>
int  ms_strncpclean ( char *dest, const char *source, int length );
int  ms_strncpopen ( char *dest, const char *source, int length );
```

## DESCRIPTION

**ms\_strncpclean** copies up to *length* characters from *source* to *dest* while removing all spaces.  The result is left justified and always NULL terminated.  The destination string must have enough room for the non-space characters within *length* and the NULL terminator, a maximum of *length* + 1.

**ms\_strncpopen** copies *length* characters from *source* to *dest* padding the right side with spaces if needed and leaves the string open-ended (unterminated).  The result will always be *length* characters and will never be NULL terminated.

These routines are useful for converting to and from known length SEED string fields.

## RETURN VALUES

**ms\_strncpclean** returns the number of characters (not including the terminating NULL) in the destination string.

**ms\_strncpopen** returns the number of characters copied from the source string.

## AUTHOR

```
Chad Trabant
IRIS Data Management Center
```
