Copy Null-Terminated String Constrained, Null Padded (STRNCPYNULLPAD)

Bound program access

Built-in number for STRNCPYNULLPAD is 12. STRNCPYNULLPAD ( target_string : address of aggregate(*) null_terminated_source_string : address of aggregate(*) maximum_length : unsigned binary(4) value which specifies the maximum number of bytes to copy ) : space pointer(16) to the target string

Description

A copy is performed from the storage specified by null terminated source string to the storage specified by target string. The copy terminates after the number of bytes specified by maximum length have been copied. However, if a null (ie. zero) character appears in the null terminated source string, no further data is copied from the string. Instead, the target string is padded with null characters. It is expected that sufficient storage exists at the location specified by target string.

Undefined results can occur if the storage locations specified by target string and null terminated source string overlap.

Note: If a null character does not appear in the null terminated source string, the target string will not be a null-terminated string.

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

24 Pointer Specification

44 Protection Violation