Merge from debian.
[hcoop/debian/courier-authlib.git] / numlib / strhdevt.c
CommitLineData
d9898ee8 1/*
2** Copyright 1998 - 2003 Double Precision, Inc.
3** See COPYING for distribution information.
4*/
5
6#if HAVE_CONFIG_H
7#include "config.h"
8#endif
9#include "numlib.h"
10#include <string.h>
11
12static const char rcsid[]="$Id: strhdevt.c,v 1.2 2003/03/12 02:45:56 mrsam Exp $";
13
14static const char xdigit[]="0123456789ABCDEF";
15
16char *libmail_strh_dev_t(dev_t t, char *arg)
17{
18char buf[sizeof(t)*2+1];
19char *p=buf+sizeof(buf)-1;
20unsigned i;
21
22 *p=0;
23 for (i=0; i<sizeof(t)*2; i++)
24 {
25 *--p= xdigit[t & 15];
26 t=t / 16;
27 }
28 return (strcpy(arg, p));
29}