Commit 0c94962 tried to fix the passcode generation of APRS checksums, but
failed. The issue is that the C version in Xastir uses a C string that is
extra large and includes the terminating NULL at the end. The loop in
ircDDBGateway using wxWidgets doesn't have this extra padding at the end.
This means that sometimes the loop can try to overflow the string when it's
getting the individual characters to calculate the passcode. The last
committer changed this so that it would attempt to not overflow the end
of the string with an if() statement.
The problem here is that the string is 0 indexed, not 1 indexed. There is
an off-by-one error in the if() statement that causes it not to calculate
the checksum of the last character in certain cases. This patch should fix
that.
Commit 0c94962 tried to fix the passcode generation of APRS checksums, but failed. The issue is that the C version in Xastir uses a C string that is extra large and includes the terminating NULL at the end. The loop in ircDDBGateway using wxWidgets doesn't have this extra padding at the end. This means that sometimes the loop can try to overflow the string when it's getting the individual characters to calculate the passcode. The last committer changed this so that it would attempt to not overflow the end of the string with an if() statement.
The problem here is that the string is 0 indexed, not 1 indexed. There is an off-by-one error in the if() statement that causes it not to calculate the checksum of the last character in certain cases. This patch should fix that.