bug in OFTime::setISOFormattedTime

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Shaeto
Posts: 147
Joined: Tue, 2009-01-20, 17:50
Location: CA, USA
Contact:

bug in OFTime::setISOFormattedTime

#1 Post by Shaeto »

lines:

if (sscanf(formattedTime.c_str(), "%02u%02u%02u%03i%02u", &hours, &minutes, &seconds, &tzHours, &tzMinutes) == 5)

and

if (sscanf(formattedTime.c_str() + pos - 1, "%03i%*c%02u", &tzHours, &tzMinutes) == 2)

according to manuals:
%i: Defaults to base 10 integers. Data starting with 0 is read as base 8.
Data starting with 0x or 0X is read as base 16.

so, setISOFormattedTime can't recognize time zones <= -0800 and >= +0800

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: bug in OFTime::setISOFormattedTime

#2 Post by J. Riesmeier »

Thank you for the report. So, "%i" should be replaced by "%d", right?

Code: Select all

d      Matches an optionally signed decimal integer; the next pointer must be a pointer to int.
Will be fixed with Commit bc268ae.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest