Close

Need help debugging printf

A project log for Kansas City Standard cassette interface

One of the protocols used in old computers for storing programs on audio cassettes

jacques-pelletierJacques Pelletier 09/01/2025 at 21:451 Comment

I'm trying to do an application to read bytes from a serial port. All work except one thing. There's a problem with printf that I can't debug.

It's supposed to print like below:
24-Filename: test-i2c.bin Begin: 0000 Length: 0000 Autostart: 0000

Instead, it prints like below:
 Begin: 0000 Len: 0000 Autostart: 0000

Here's the link to the code:

https://drive.google.com/file/d/1tHx_rlAkCgr7jk63LzPzAOijSgH_YXZw/view?usp=drive_link

I commented the code to explain the bug in more details. See function GetData in file tape.c

Discussions

Jacques Pelletier wrote 09/02/2025 at 01:32 point

Solved it. A carriage return in a string throwed a curve ball to printf. That was another tough nut to crack!

  Are you sure? yes | no