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
fmt_copybytes_sizeof_minus1(3) FreeBSD Library Functions Manual fmt_copybytes_sizeof_minus1(3)

fmt_copybytes_sizeof_minus1 - write binary data

#include <libowfat/fmt.h>

size_t fmt_copybytes_sizeof_minus1(char *dest,const char *source);

This macro will copy sizeof(source)-1 bytes from source to dest.

This is a convenience wrapper interface around fmt_copybytes for the situation where you construct a binary message by concatenating hex constant strings like this:


fmt_copybytes_sizeof_minus1(dest, "\x01\x02\x03\x04");

Since the source is technically a string, the compiler will add a 0 byte and sizeof() will return the size including that 0 byte. That is why we have a minus 1 in this function, so we do not copy or count that 0 byte.

Caution: source must not have side effects or those will be evaluated twice.

fmt_copybytes(3)


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.