Logo Search packages:      
Sourcecode: bglibs version File versions

int str_diffb ( const str a,
const char *  b,
unsigned  len 
)

Differentiate a string and a binary block.

Definition at line 41 of file diff.c.

References len, and s.

Referenced by str_diff(), and str_diffs().

{
  unsigned max;
  char* aptr;
  max = a->len;
  if (max > len) max = len;
  for (aptr = a->s; max; ++aptr, ++b, --max)
    if (*b - *aptr) return *b - *aptr;
  if (a->len > len) return 1;
  if (a->len < len) return -1;
  return 0;
}


Generated by  Doxygen 1.6.0   Back to index