I tried building the 1.1.2 source on power pc OSX and discovered that it crashes upon login.
I've tracked this down to a section of code in netclient.c to do with the number of repetitions. Near the comment "Draw a character n times"
The packet_scanf is told to read a single byte "%c", however it's stored in a int and I've seen that it returned a large value >255.
I put a work around in by ANDing it with 255 but I've noticed a number of other issues, such as not being able to select a spell book when casting a spell, inventory updates occur very slowly with Identify or Selling items. I'm suspecting this is due to packet_scanf issues.
Could all these be packet_scanf related?
Cheers
Mark
Another Packet_scanf bug?
-
- Human Zombie
- Posts: 28
- Joined: Sun 12.12.2010, 23:26
- Location: Melbourne, Australia
- Contact:
Another Packet_scanf bug?
--
Project Mangband OSX Carbon Developer.
Project Mangband OSX Carbon Developer.
-
- Human Zombie
- Posts: 28
- Joined: Sun 12.12.2010, 23:26
- Location: Melbourne, Australia
- Contact:
Re: Another Packet_scanf bug?
I've checked through the Packet_scanf function and it appears to be ok.
It's told to read a character "%c" and it is stored in an int. Obviously the old data in the int is not overwritten.
I forgot to mention that it was in the Receive_objflags function.
I looked through the rest of the netclient code and it appears that Receive_objflags is the only function that declares variable n as an int, when using Packet_scanf to read a character into n.
I assume this is a bug in Receive_objflags, declaring n as an int and not a char like the other functions. I don't see any reason it should be declared as an int.
I'll test this change on my PPC OSX machine when I get home.
Mark
It's told to read a character "%c" and it is stored in an int. Obviously the old data in the int is not overwritten.
I forgot to mention that it was in the Receive_objflags function.
I looked through the rest of the netclient code and it appears that Receive_objflags is the only function that declares variable n as an int, when using Packet_scanf to read a character into n.
I assume this is a bug in Receive_objflags, declaring n as an int and not a char like the other functions. I don't see any reason it should be declared as an int.
I'll test this change on my PPC OSX machine when I get home.
Mark
--
Project Mangband OSX Carbon Developer.
Project Mangband OSX Carbon Developer.
Re: Another Packet_scanf bug?
http://mangband.org/developer/ticket/855
This bug was fixed for 1.2, check the bug database for the proper fix.
This bug was fixed for 1.2, check the bug database for the proper fix.
-
- Human Zombie
- Posts: 28
- Joined: Sun 12.12.2010, 23:26
- Location: Melbourne, Australia
- Contact:
Re: Another Packet_scanf bug?
Where is 1.2? I've only seen a release for 1.1.2 and the svn branch for 1.1.3 and trunk.
--
Project Mangband OSX Carbon Developer.
Project Mangband OSX Carbon Developer.