Imported Upstream version 0.66.1
[hcoop/debian/courier-authlib.git] / libs / 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
d9898ee8 12
13static const char xdigit[]="0123456789ABCDEF";
14
15char *libmail_strh_dev_t(dev_t t, char *arg)
16{
17char buf[sizeof(t)*2+1];
18char *p=buf+sizeof(buf)-1;
19unsigned i;
20
21 *p=0;
22 for (i=0; i<sizeof(t)*2; i++)
23 {
24 *--p= xdigit[t & 15];
25 t=t / 16;
26 }
27 return (strcpy(arg, p));
28}