X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/blobdiff_plain/52b866481399dfcecd295560800d3e3fe0090f24..26936c8341691d67655a055956656f2506d53a63:/server/servutil.c diff --git a/server/servutil.c b/server/servutil.c index 1f6301a4..f19ce531 100644 --- a/server/servutil.c +++ b/server/servutil.c @@ -30,45 +30,10 @@ /*----- Global variables --------------------------------------------------*/ -octet buf_i[PKBUFSZ], buf_o[PKBUFSZ], buf_t[PKBUFSZ]; +octet buf_i[PKBUFSZ], buf_o[PKBUFSZ], buf_t[PKBUFSZ], buf_u[PKBUFSZ]; /*----- Main code ---------------------------------------------------------*/ -/* --- @mpstr@ --- * - * - * Arguments: @mp *m@ = a multiprecision integer - * - * Returns: A pointer to the integer's textual representation. - * - * Use: Converts a multiprecision integer to a string. Corrupts - * @buf_t@. - */ - -const char *mpstr(mp *m) -{ - if (mp_writestring(m, (char *)buf_t, sizeof(buf_t), 10)) - return (""); - return ((const char *)buf_t); -} - -/* --- @gestr@ --- * - * - * Arguments: @group *g@ = a group - * @ge *x@ = a group element - * - * Returns: A pointer to the element's textual representation. - * - * Use: Converts a group element to a string. Corrupts - * @buf_t@. - */ - -const char *gestr(group *g, ge *x) -{ - if (group_writestring(g, x, (char *)buf_t, sizeof(buf_t))) - return (""); - return ((const char *)buf_t); -} - /* --- @timestr@ --- * * * Arguments: @time_t t@ = a time to convert @@ -76,7 +41,7 @@ const char *gestr(group *g, ge *x) * Returns: A pointer to a textual representation of the time. * * Use: Converts a time to a textual representation. Corrupts - * @buf_t@. + * @buf_u@. */ const char *timestr(time_t t) @@ -85,8 +50,8 @@ const char *timestr(time_t t) if (!t) return ("NEVER"); tm = localtime(&t); - strftime((char *)buf_t, sizeof(buf_t), "%Y-%m-%dT%H:%M:%S", tm); - return ((const char *)buf_t); + strftime((char *)buf_u, sizeof(buf_u), "%Y-%m-%dT%H:%M:%S", tm); + return ((const char *)buf_u); } /* --- @mystrieq@ --- *