Copy Null-Terminated String Constrained (STRNCPYNULL)

Bound program access

Built-in number for STRNCPYNULL is 13. STRNCPYNULL ( 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 a null (ie. zero) character is copied or the number of bytes specified by maximum length have been copied (which ever comes first). However, if a null character is not copied, one will be appended to the end of the target string. Thus, the maximum number of characters which may be copied is one more than the value of maximum length. 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.

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

24 Pointer Specification

44 Protection Violation