On Tue, 15 Jul 2014 17:35:59 +0100 Alex Anderson <alexanderandersonofando...@gmail.com> wrote:
Hey Alex, > * why have fixed-size width and height fields if they're between > "blank" bytes? Is for simpler read code? it's been done this way to make parsing easier. Knowing the header is always 30 chars long saves you from having to fiddle with it too much. > * is "blank" ASCII-blank, or '0x00'? (From the write-code, it looks like > ASCII) Definitely ASCII-blank. 0x00 doesn't work well with all these printf-functions. I tested a solution with 0x00 instead of blanks, but quickly ran into issues with the fancy string-handling-functions. You'd basically have to do it char-by-char then and "reinvent" printf or snprintf to a buffer and then manually swap out placeholders with 0x00. Cheers FRIGN -- FRIGN <d...@frign.de>