You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
312 B
C
13 lines
312 B
C
19 years ago
|
#include <rangecheck.h>
|
||
|
|
||
|
/* does an ASCIIZ string starting at "ptr" lie in buf[0..len-1]? */
|
||
|
int range_strinbuf(const void* buf,size_t len,const void* stringstart) {
|
||
|
const char* x;
|
||
|
const char* y;
|
||
|
if (!range_ptrinbuf(buf,len,x=stringstart)) return 0;
|
||
|
y=x+len;
|
||
|
for (; x<y && *x; ++x);
|
||
|
return (x<y);
|
||
|
}
|
||
|
|