Re: File load magic misfeature and workaround

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 30, 1999 at 04:10:04PM +1100, David Hodson <hodsond@xxxxxxxxxxxxxx> wrote:
> Well, specifying a magic of "0,long,0x802A5FD7" calls
> strtol("0x802A5FD7"),

actually, strtol("802A5FD7",16)

> which returns MAX_LONG (0x7FFFFFFF) (and presumably an error). strtoul()
> might work better, but as I said, I didn't want to break anyone else's
> magic numbers.

> > Would specifying the right (signed) constant help?
> Maybe. But bits is bits, you know.

Yes, so it shouldn't matter wether you specify them signed or not. gimp
will not run on machines with one-complement integers ;)

I do depend on signedness of my magic constants in one filter, but if gimp
would be changed to use strtoul for _hex_ constants everybody could be
happy.

Hey people! Does anybody think that using strtoul for hex constants breaks
anything? If not I'll change it next week.

-- 
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       pcg@xxxxxxxxxxxxx |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux