resetting manifest requested domain to floor
[platform/upstream/deltarpm.git] / cpio.c
1 /*
2  * Copyright (c) 2004 Michael Schroeder (mls@suse.de)
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  */
7
8 #include <stdio.h>
9 #include <stdlib.h>
10
11 #include "cpio.h"
12
13 /****************************************************************
14  *
15  * cpio archive
16  *
17  */
18
19 unsigned int cpion(char *s)
20 {
21   int i;  
22   unsigned int r = 0;
23   for (i = 0; i < 8; i++, s++)
24     if (*s >= '0' && *s <= '9') 
25       r = (r << 4) | (*s - '0'); 
26     else if (*s >= 'a' && *s <= 'f') 
27       r = (r << 4) | (*s - ('a' - 10)); 
28     else if (*s >= 'A' && *s <= 'F') 
29       r = (r << 4) | (*s - ('a' - 10)); 
30     else    
31       {
32         fprintf(stderr, "bad cpio archive\n");
33         exit(1);
34       }
35   return r;
36 }
37