From 38b245b46a51be82a5a5f798255cbbbbc0186f78 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 29 Dec 2010 12:00:30 +0100 Subject: Move files copied from maildrop to a separate hierarchy. Signed-off-by: Thomas Schwinge --- contrib/notmuch-deliver/maildrop/numlib/strofft.c | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 contrib/notmuch-deliver/maildrop/numlib/strofft.c (limited to 'contrib/notmuch-deliver/maildrop/numlib/strofft.c') diff --git a/contrib/notmuch-deliver/maildrop/numlib/strofft.c b/contrib/notmuch-deliver/maildrop/numlib/strofft.c new file mode 100644 index 00000000..d93edcbe --- /dev/null +++ b/contrib/notmuch-deliver/maildrop/numlib/strofft.c @@ -0,0 +1,37 @@ +/* +** Copyright 1998 - 2002 Double Precision, Inc. +** See COPYING for distribution information. +*/ + +#if HAVE_CONFIG_H +#include "config.h" +#endif +#include "numlib.h" +#include + +static const char rcsid[]="$Id: strofft.c,v 1.5 2003/01/05 04:01:17 mrsam Exp $"; + +char *libmail_str_off_t(off_t t, char *arg) +{ + char buf[NUMBUFSIZE]; + char *p=buf+sizeof(buf)-1; + int isneg=0; + + if (t < 0) + { + t= -t; + isneg=1; + } + + *p=0; + do + { + *--p= '0' + (t % 10); + t=t / 10; + } while(t); + + if (isneg) + *--p='-'; + + return (strcpy(arg, p)); +} -- cgit v1.2.3