Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   pmstrncpy    ( 3 )

безопасная копия строки (safe string copy)

Имя (Name)

pmstrncpy - safe string copy


Синопсис C (C Synopsis)

#include <pcp/pmapi.h>

int pmstrncpy(char *dest, size_t destlen, char *src);

cc ... -lpcp


Описание (Description)

pmstrncpy is safe string copying routine with semantics similar to strncpy(3).

The main differences are that src must be null-byte terminated, destlen is the length of the destination buffer (dest) not the length of the source string (src), and pmstrncpy ensures that dest is null-byte terminated, even when strlen(src) is larger than destlen.

On success, pmstrncpy returns 0, else -1 indicates that src is too big and the result been truncated to ensure dest has no been overrun.


Смотри также (See also)

pmstrncat(3) and strncpy(3).