SQL Error?
#2

Use %c to print a single character instead of %s. Format works in a quite mysterious way when you specify a string with an index, which may not always be understood. Basically it starts the string at the specified but it also writes the rest of the string. So if you have your string "ABCDEFGH..." and you access string[2] it will output "CDEFGH..." instead of just 'C'. I think it also overwrites the null terminator in the buffer. This causes buffer overflow which causes other variables to be overwritten inadvertently; 55 happens to be the character code for the character '7' and 80 is the character code for the character 'P'.
Reply


Messages In This Thread
SQL Error? - by adamslj - 25.08.2017, 15:00
Re: SQL Error? - by Vince - 25.08.2017, 15:27
Re: SQL Error? - by adamslj - 25.08.2017, 15:46
Re: SQL Error? - by adamslj - 25.08.2017, 16:06
Re: SQL Error? - by thegamer355 - 25.08.2017, 16:52
Re: SQL Error? - by adamslj - 25.08.2017, 17:31
Re: SQL Error? - by adamslj - 25.08.2017, 18:25
Re: SQL Error? - by Vince - 25.08.2017, 18:32
Re: SQL Error? - by thegamer355 - 25.08.2017, 18:39
Re: SQL Error? - by adamslj - 25.08.2017, 19:20

Forum Jump:


Users browsing this thread: 3 Guest(s)