aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2006-10-25 08:36:28 +0000
committerAndreas Steffen <andreas.steffen@strongswan.org>2006-10-25 08:36:28 +0000
commitb81f5ce23f6d0876e2f871230e6a45454353e62a (patch)
tree864f2f8f1f6e7f1a871316e654f6e8f6a100f8bd /src
parentbeb67fd9d57f1937ae16177652b90cdc254b1066 (diff)
downloadstrongswan-b81f5ce23f6d0876e2f871230e6a45454353e62a.tar.bz2
strongswan-b81f5ce23f6d0876e2f871230e6a45454353e62a.tar.xz
fixed two bugs in the time_t and chunk_ct print functions
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/types.c7
1 files 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);
}
/**