vitasdk
Documentation of the vitasdk

Exports for User. More...

Functions

char * strncat (char *dest, const char *src, size_t count)
 Append at most count characters from one string to another.
 
int strncpy_s (char *dest, size_t dest_size, const char *src, size_t count)
 Copy at most count characters with runtime-constraint checks.
 

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:

#include <psp2/libc.h>


Link the library to the executable:

SceLibc_stub



Function Documentation

◆ strncat()

char * strncat ( char *  dest,
const char *  src,
size_t  count 
)

Append at most count characters from one string to another.

A NUL is always written after the appended characters. The function does not know the destination capacity and does not check for overlapping buffers or writes past the end of the destination buffer.

Parameters
[in,out]destNUL-terminated destination string.
[in]srcNUL-terminated source string.
[in]countMaximum number of source characters to append.
Returns
dest.

◆ strncpy_s()

int strncpy_s ( char *  dest,
size_t  dest_size,
const char *  src,
size_t  count 
)

Copy at most count characters with runtime-constraint checks.

On success, FW 3.60 copies strnlen_s(src, count) characters and appends a NUL. The destination capacity must be greater than the number of characters copied, and the source characters must not overlap any part of the destination buffer.

A NULL destination, zero destination capacity, or capacity greater than INT_MAX calls the runtime constraint handler without writing the destination. A NULL source, count greater than INT_MAX, insufficient capacity, or overlap first sets dest[0] to NUL and then calls the handler.

This four-argument SceLibc export is ABI-incompatible with the distinct three-argument SceSysclib strncpy_s export declared in psp2kern/kernel/sysclib.h.

Parameters
[out]destDestination buffer.
[in]dest_sizeTotal destination capacity.
[in]srcSource string.
[in]countMaximum number of source characters to examine and copy.
Returns
0 on success, or 34 (ERANGE) after a runtime-constraint violation.