---
name: "range_ptrinbuf"
section: "3diet"
platform: "linux"
package: "libowfat-dev"
version: "0.28-2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/range_ptrinbuf/3diet"
---

# range\_ptrinbuf(3diet)

range check pointer in buffer

## NAME

range\_ptrinbuf - range check pointer in buffer

## SYNTAX

**#include \<rangecheck.h\>**

int **range\_ptrinbuf**(const void\* buf,size\_t len,const void\* ptr);

## DESCRIPTION

range\_ptrinbuf checks if *ptr* points to *buf*\[0..*len*-1\].

## RETURN VALUE

If the buffer is implausible (buf is NULL or buf+len has an integer overflow), return 0.

If *ptr* points to one of *buf*\[0\], *buf*\[1\], ... or *buf*\[*len*-1\], return 1.

Otherwise, return 0.

## SEE ALSO

[rangecheck(3)](/rangecheck/3.md)
