FreeBSD/sys/geom/part/g_part_ldm.c
/* Read the variable-width string and return new offset */
Read the variable-width string and return new offset
Read the variable - width string and return new offset
static int
ldm_vstr_get(const u_char *buf, int offset, u_char *result,
    size_t maxlen, size_t range)
{
	uint8_t len;
	len = buf[offset++];
	if (len >= maxlen || len + offset >= range)
		return (-1);
	memcpy(result, buf + offset, len);
	result[len] = '\0';
	return (offset + len);
}
static int ldm_vstr_get ( const u_char * buf , int offset , u_char * result , size_t maxlen , size_t range ) { uint8_t len ; len = buf [ offset ++ ] ; if ( len >= maxlen || len + offset >= range ) return ( -1 ) ; memcpy ( result , buf + offset , len ) ; result [ len ] = ' \0 ' ; return ( offset + len ) ; }
Read the variable-width string and return new offset
Read the variable - width string and return new offset