Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not 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

  1. #include <rangecheck.h>
  2. /* does an ASCIIZ string starting at "ptr" lie in buf[0..len-1]? */
  3. int range_strinbuf(const void* buf,size_t len,const void* stringstart) {
  4. const char* x;
  5. const char* y;
  6. if (!range_ptrinbuf(buf,len,x=stringstart)) return 0;
  7. y=x+len;
  8. for (; x<y && *x; ++x);
  9. return (x<y);
  10. }