# HG changeset patch # User Michael Pavone # Date 1648361108 25200 # Node ID 9209858b2f74dd41e8f3ca6ee5cce356005b27d9 # Parent 2da377ea932fc8471e4acefebd40b26797310afb Fix a couple of bugs in the TOC file parser diff -r 2da377ea932f -r 9209858b2f74 cdimage.c --- a/cdimage.c Sat Mar 26 20:14:41 2022 -0700 +++ b/cdimage.c Sat Mar 26 23:05:08 2022 -0700 @@ -55,12 +55,15 @@ static uint32_t timecode_to_lba(char *timecode) { char *end; - int seconds = 0, frames = 0; - int minutes = strtol(timecode, &end, 10); - if (end) { + int seconds = 0, minutes = 0; + int frames = strtol(timecode, &end, 10); + if (end && *end == ':') { timecode = end + 1; - seconds = strtol(timecode, &end, 10); - if (end) { + seconds = frames; + frames = strtol(timecode, &end, 10); + if (end && *end == ':') { + minutes = seconds; + seconds = frames; timecode = end + 1; frames = strtol(timecode, NULL, 10); } @@ -471,7 +474,7 @@ if (isdigit(*cmd)) { uint32_t start = timecode_to_lba(cmd); tracks[track].file_offset += start * tracks[track].sector_bytes; - cmd = next_blank(cmd); + cmd = cmd_start_sameline(cmd); } } if (isdigit(*cmd)) {