treat hsecsincemidn as a signed integer

This commit is contained in:
Sean Rhea
2009-08-09 19:51:24 -07:00
parent 6ce20ccb29
commit fc4108904f

View File

@@ -148,7 +148,12 @@ bool readSrmFile(QFile &file, SrmData &data, QStringList &errorStrings)
blockhdr *blockhdrs = new blockhdr[blockcnt];
for (int i = 0; i < blockcnt; ++i) {
quint32 hsecsincemidn = readLong(in);
// In the .srm files generated by Rainer Clasen's srmcmd,
// hsecsincemidn is a *signed* 32-bit integer. I haven't seen a
// negative value in any .srm files generated by srmwin.exe, but
// since the number of hundredths of a second in a day is << 2^31,
// it seems safe to always treat this number as signed.
qint32 hsecsincemidn = readLong(in);
blockhdrs[i].chunkcnt = readShort(in);
blockhdrs[i].dt = QDateTime(date);
blockhdrs[i].dt = blockhdrs[i].dt.addMSecs(hsecsincemidn * 10);