Re: [dev] Looking for simple, alpha supporting image format
FRIGN wrote:
> On Tue, 15 Jul 2014 19:55:16 +0200
> Markus Teich <markus.teich_AT_stusta.mhn.de> wrote:
>
> > Why do you overwrite the blanks before checking if they are blanks? If the file
> > format specifies these characters as blanks, they should be checked for.
> > Otherwise the format specification should not say „blank“ but „any one byte“.
>
> There obviously is a little confusion about blanks (0x00) and
> ASCII-blanks. Replacing the "spaces" with \0 is just a trick and has
> nothing to do with the data-represenation.
So you mean the word „blank“ in the file format specification already means
„anything with the size of one byte“?
If it means either ASCII blank (0x20) or null blank (0x00), the respective bytes
should still be checked when parsing:
if(*(data+9) != ' ' || *(data+19) != ' ' || *(data+29) != ' ')
return NULL;
or respectively:
if(*(data+9) != '\0' || *(data+19) != '\0' || *(data+29) != '\0')
return NULL;
However if we don't want to check this when parsing, as your code does, we
should change the file format specification to be more precise (the word „blank“
obviously is confusing in more than one dimension):
9 "imagefile"
1 any one byte
9 …
I hope this explains my issue.
--Markus
Received on Tue Jul 15 2014 - 20:40:08 CEST
This archive was generated by hypermail 2.3.0
: Tue Jul 15 2014 - 20:48:07 CEST