|
NAMEfmt_copybytes_sizeof_minus1 - write binary data SYNTAX#include <libowfat/fmt.h> size_t fmt_copybytes_sizeof_minus1(char *dest,const char *source); DESCRIPTIONThis 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:
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. NOTECaution: source must not have side effects or those will be evaluated twice. SEE ALSOfmt_copybytes(3)
|