Changeset 8646 in ntrip for trunk/BNC/src/bncutils.cpp


Ignore:
Timestamp:
Mar 29, 2019, 9:23:34 AM (6 years ago)
Author:
stuerze
Message:

big fixed in NMEA checksum

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncutils.cpp

    r8617 r8646  
    302302  gga += QString(",%1,").arg(hei, 2, 'f', 1);
    303303  gga += QString("M,10.000,M,,");
    304   int xori;
    305 
    306   char XOR = 0;
    307   char Buff[gga.size()];
    308   strncpy(Buff, gga.toLatin1().data(), gga.size());
    309   int iLen = strlen(Buff);
    310   for (xori = 0; xori < iLen; xori++) {
    311     XOR ^= (char)Buff[xori];
     304
     305  unsigned char XOR = 0;
     306  for (int ii = 0; ii < gga.length(); ii++) {
     307    XOR ^= (unsigned char) gga[ii].toLatin1();
    312308  }
    313309  gga = "$" + gga + QString("*%1").arg(XOR, 2, 16, QLatin1Char('0'));
Note: See TracChangeset for help on using the changeset viewer.