kernels/linux-2.4.0/net/decnet/dn_nsp_in.c
/**
 * dn_check_idf - Check an image data field format is correct.
 * @pptr: Pointer to pointer to image data
 * @len: Pointer to length of image data
 * @max: The maximum allowed length of the data in the image data field
 * @follow_on: Check that this many bytes exist beyond the end of the image data
 *
 * Returns: 0 if ok, -1 on error
 */
Check an image data field format is correct.
@pptr: Pointer to pointer to image data
@len: Pointer to length of image data
@max: The maximum allowed length of the data in the image data field
@follow_on: Check that this many bytes exist beyond the end of the image data

0 if ok, -1 on error
Check an image data field format is correct . @pptr : Pointer to pointer to image data @len : Pointer to length of image data @max : The maximum allowed length of the data in the image data field @follow_on : Check that this many bytes exist beyond the end of the image data 0 if ok - 1 on error
static inline int dn_check_idf(unsigned char **pptr, int *len, unsigned char max, unsigned char follow_on)
{
	unsigned char *ptr = *pptr;
	unsigned char flen = *ptr++;
	(*len)--;
	if (flen > max)
		return -1;
	if ((flen + follow_on) > *len)
		return -1;
	*len -= flen;
	*pptr = ptr + flen;
	return 0;
}
static inline int dn_check_idf ( unsigned char * * pptr , int * len , unsigned char max , unsigned char follow_on ) { unsigned char * ptr = * pptr ; unsigned char flen = * ptr ++ ; ( * len ) -- ; if ( flen > max ) return -1 ; if ( ( flen + follow_on ) > * len ) return -1 ; * len -= flen ; * pptr = ptr + flen ; return 0 ; }
dn_check_idf - Check an image data field format is correct.
dn_check_idf - Check an image data field format is correct .