summaryrefslogtreecommitdiffstats
path: root/src/lib/krb4/vmsswab.c
blob: 019580882e2632b3a7ac13de2caee8ac79d8c496 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* Copyright 1994 Cygnus Support */
/* Mark W. Eichin */
/*
 * Permission to use, copy, modify, and
 * distribute this software and its documentation for any purpose and
 * without fee is hereby granted, provided that the above copyright
 * notice appear in all copies and that both that copyright notice and
 * this permission notice appear in supporting documentation.
 * Cygnus Support makes no representations about the suitability of
 * this software for any purpose.  It is provided "as is" without express
 * or implied warranty.
 */

/* VMS doesn't have swab, but everything else does */
/* so make this available anyway ... someday it might go
   into the VMS makefile fragment, but for now it is only
   referenced by l.com. */

swab(from,to,nbytes) 
        char *from;
        char *to;
        int nbytes;
{
	char tmp;

        while ( (nbytes-=2) >= 0 ) {
		tmp = from[1];
                to[1] = from[0];
		to[0] = tmp;
                to++; to++;
                from++; from++;
        }
}