~ubuntu-branches/ubuntu/oneiric/daemontools/oneiric

« back to all changes in this revision

Viewing changes to daemontools-0.76/src/byte_diff.c

  • Committer: Bazaar Package Importer
  • Author(s): Gerrit Pape
  • Date: 2008-04-16 21:20:38 UTC
  • Revision ID: james.westby@ubuntu.com-20080416212038-2ix54o7w5m8lpvni
Tags: upstream-0.76
ImportĀ upstreamĀ versionĀ 0.76

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Public domain. */
 
2
 
 
3
#include "byte.h"
 
4
 
 
5
int byte_diff(s,n,t)
 
6
register char *s;
 
7
register unsigned int n;
 
8
register char *t;
 
9
{
 
10
  for (;;) {
 
11
    if (!n) return 0; if (*s != *t) break; ++s; ++t; --n;
 
12
    if (!n) return 0; if (*s != *t) break; ++s; ++t; --n;
 
13
    if (!n) return 0; if (*s != *t) break; ++s; ++t; --n;
 
14
    if (!n) return 0; if (*s != *t) break; ++s; ++t; --n;
 
15
  }
 
16
  return ((int)(unsigned int)(unsigned char) *s)
 
17
       - ((int)(unsigned int)(unsigned char) *t);
 
18
}