GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
BSON_STRNCPY(3) libbson BSON_STRNCPY(3)

void
bson_strncpy (char *dst, const char *src, size_t size);


  • dst: The destination buffer.
  • src: The src buffer.
  • size: The number of bytes to copy into dst, which must be at least that size.

Copies up to size bytes from src into dst. dst must be at least size bytes in size. A trailing \0 is always set.

Does nothing if size is zero.

bson_strncpy matches the behavior of the C11 standard strncpy_s, rather than strncpy. This means that bson_strncpy always writes a null terminator to dst, even if dst is too short to fit the entire string from src. If there is additional space left in dst after copying src, bson_strncpy does not fill the remaining space with null characters.

MongoDB, Inc

2009-present, MongoDB, Inc.

July 3, 2025 1.30.4

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.