/* Read an (unaligned) value of length 1..4 bytes  */
static unsigned int adfs_readval(unsigned char *p, int len)
/* Read an (unaligned) value of length 1..4 bytes  */
static unsigned int adfs_readval(unsigned char *p, int len)
{
	unsigned int val = 0;
	switch (len) {
	case 4:		val |= p[3] << 24;
	case 3:		val |= p[2] << 16;
	case 2:		val |= p[1] << 8;
	default:	val |= p[0];
	}
	return val;
}