Back to index

courier  0.68.2
strhpidt.c
Go to the documentation of this file.
00001 /*
00002 ** Copyright 1998 - 2000 Double Precision, Inc.
00003 ** See COPYING for distribution information.
00004 */
00005 
00006 #if    HAVE_CONFIG_H
00007 #include      "config.h"
00008 #endif
00009 #include      "numlib.h"
00010 #include      <string.h>
00011 
00012 
00013 static const char xdigit[]="0123456789ABCDEF";
00014 
00015 char *libmail_strh_pid_t(pid_t t, char *arg)
00016 {
00017 char   buf[sizeof(t)*2+1];
00018 char   *p=buf+sizeof(buf)-1;
00019 unsigned i;
00020 
00021        *p=0;
00022        for (i=0; i<sizeof(t)*2; i++)
00023        {
00024               *--p= xdigit[t & 15];
00025               t=t / 16;
00026        }
00027        return (strcpy(arg, p));
00028 }