openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/util-linux/2.33.2-r0/util-linux-2.33.2/libblkid/src/probe.c
int blkid_probe_value_set_data(struct blkid_prval* v, const unsigned char* data,
                               size_t len)
{
    v->data = calloc(1, len + 1); /* always terminate by \0 */

    if (!v->data)
        return -ENOMEM;
    memcpy(v->data, data, len);
    v->len = len;
    return 0;
}
/* Note that value data is always terminated by zero to keep things robust,
 * this extra zero is not count to the value length. It's caller responsibility
 * to set proper value length (for strings we count terminator to the length,
 * for binary data it's without terminator).
 */
Note that value data is always terminated by zero to keep things robust,
this extra zero is not count to the value length. It's caller responsibility
to set proper value length (for strings we count terminator to the length,
for binary data it's without terminator).
Note that value data is always terminated by zero to keep things robust this extra zero is not count to the value length . It ' s caller responsibility to set proper value length ( for strings we count terminator to the length for binary data it ' s without terminator ) .
int blkid_probe_value_set_data(struct blkid_prval* v, const unsigned char* data,
                               size_t len)
{
    v->data = calloc(1, len + 1); 
    if (!v->data)
        return -ENOMEM;
    memcpy(v->data, data, len);
    v->len = len;
    return 0;
}
int blkid_probe_value_set_data ( struct blkid_prval * v , const unsigned char * data , size_t len ) { v -> data = calloc ( 1 , len + 1 ) ; if ( ! v -> data ) return - ENOMEM ; memcpy ( v -> data , data , len ) ; v -> len = len ; return 0 ; }
Note that value data is always terminated by zero to keep things robust,
 this extra zero is not count to the value length.
Note that value data is always terminated by zero to keep things robust this extra zero is not count to the value length .
/* always terminate by \0 */