X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fgenstamp.c;h=9c5ba5f3d6e613c3c1f15ecb2781ac3438a49bb5;hb=2b80e75820618944e1c75b9c01aeeefc8b6b0c81;hp=e97fb97963fac9084ed1650310851009e73a5757;hpb=c7209f051c44912da2e367e984a8c8660b9139d2;p=citadel.git diff --git a/citadel/genstamp.c b/citadel/genstamp.c index e97fb9796..9c5ba5f3d 100644 --- a/citadel/genstamp.c +++ b/citadel/genstamp.c @@ -1,14 +1,7 @@ /* - * $Id$ - * * Function to generate RFC822-compliant textual time/date stamp - * */ -#ifdef DLL_EXPORT -#define IN_LIBCIT -#endif - #include "sysdep.h" #include #include @@ -43,7 +36,7 @@ static char *weekdays[] = { * Supplied with a unix timestamp, generate an RFC822-compliant textual * time and date stamp. */ -void datestring(char *buf, size_t n, time_t xtime, int which_format) { +long datestring(char *buf, size_t n, time_t xtime, int which_format) { struct tm t; long offset; @@ -69,7 +62,9 @@ void datestring(char *buf, size_t n, time_t xtime, int which_format) { switch(which_format) { case DATESTRING_RFC822: - snprintf(buf, n, "%s, %02d %s %04d %02d:%02d:%02d %c%04ld", + return snprintf( + buf, n, + "%s, %02d %s %04d %02d:%02d:%02d %c%04ld", weekdays[t.tm_wday], t.tm_mday, months[t.tm_mon], @@ -82,7 +77,9 @@ void datestring(char *buf, size_t n, time_t xtime, int which_format) { break; case DATESTRING_IMAP: - snprintf(buf, n, "%02d-%s-%04d %02d:%02d:%02d %c%04ld", + return snprintf( + buf, n, + "%02d-%s-%04d %02d:%02d:%02d %c%04ld", t.tm_mday, months[t.tm_mon], t.tm_year + 1900, @@ -94,5 +91,5 @@ void datestring(char *buf, size_t n, time_t xtime, int which_format) { break; } + return 0; } -