From b81f5ce23f6d0876e2f871230e6a45454353e62a Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Wed, 25 Oct 2006 08:36:28 +0000 Subject: [PATCH] fixed two bugs in the time_t and chunk_ct print functions --- src/libstrongswan/types.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libstrongswan/types.c b/src/libstrongswan/types.c index 70cedfbfc..8e201f87b 100644 --- a/src/libstrongswan/types.c +++ b/src/libstrongswan/types.c @@ -287,7 +287,6 @@ static int print_chunk(FILE *stream, const struct printf_info *info, while (copy.len > 0) { - static char hexdig[] = "0123456789abcdef"; if (first) { first = FALSE; @@ -296,9 +295,7 @@ static int print_chunk(FILE *stream, const struct printf_info *info, { written += fprintf(stream, ":"); } - written += fprintf(stream, "%c%c", - hexdig[(*copy.ptr >> 4) & 0x0f], - hexdig[ *copy.ptr++ & 0x0f]); + written += fprintf(stream, "%02x", *copy.ptr++); copy.len--; } return written; @@ -337,7 +334,7 @@ static int print_time(FILE *stream, const struct printf_info *info, } return fprintf(stream, "%s %02d %02d:%02d:%02d%s%04d", months[t.tm_mon], t.tm_mday, t.tm_hour, t.tm_min, - t.tm_sec, info->alt ? " UTC " : " ", t.tm_year + 1900); + t.tm_sec, utc ? " UTC " : " ", t.tm_year + 1900); } /**