Logo Search packages:      
Sourcecode: likewise-open version File versions

char* skip_string ( const char *  base,
size_t  len,
char *  buf 
)

Skip past a string in a buffer. Buffer may not be null terminated. end_ptr points to the first byte after then end of the buffer.

Definition at line 455 of file util_str.c.

{
      const char *end_ptr = base + len;

      if (end_ptr < base || !base || !buf || buf >= end_ptr) {
            return NULL;
      }

      /* Skip the string */
      while (*buf) {
            buf++;
            if (buf >= end_ptr) {
                  return NULL;
            }
      }
      /* Skip the '\0' */
      buf++;
      return buf;
}


Generated by  Doxygen 1.6.0   Back to index