Skip to content

Commit

Permalink
log_line(): correctly calculate delta time when no color is used
Browse files Browse the repository at this point in the history
The update of last_time was only done in case of colorization
(LogDoColor). So on unsupported consoles the time was wrong.


git-svn-id: svn:https://anonscm.debian.org/svn/pcsclite/trunk/PCSC@5896 0ce88b0d-b2fd-0310-8134-9614164e65ea
  • Loading branch information
LudovicRousseau committed Aug 21, 2011
1 parent b7c52e5 commit 1e4c616
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/debuglog.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ static void log_line(const int priority, const char *DebugBuffer)
else
delta = 99999999;

last_time = new_time;

if (LogDoColor)
{
const char *color_pfx = "", *color_sfx = "\33[0m";
Expand Down Expand Up @@ -164,7 +166,6 @@ static void log_line(const int priority, const char *DebugBuffer)

printf("%s%.8d%s %s%s%s\n", time_pfx, delta, time_sfx,
color_pfx, DebugBuffer, color_sfx);
last_time = new_time;
}
else
{
Expand Down

0 comments on commit 1e4c616

Please sign in to comment.