File: stralloc_diffs.c

package info (click to toggle)
libowfat 0.22-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,148 kB
  • ctags: 976
  • sloc: ansic: 10,424; makefile: 42
file content (14 lines) | stat: -rw-r--r-- 315 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "stralloc.h"
#include "byte.h"
#include "str.h"

extern int stralloc_diffs(const stralloc* a,const unsigned char* b) {
  register unsigned long int i;
  register int j;
  for (i=0;;++i) {
    if (i==a->len) return (!b[i])?0:-1; if (!b[i]) return 1;
    if ((j=(a->s[i]-b[i]))) return j;
  }
  return j;
}