1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

Make it terminate the string properly.

This commit is contained in:
mikeller 2018-06-03 22:43:12 +12:00
parent 0aba86ccb4
commit fa24697df6

View file

@ -274,10 +274,9 @@ static void osdFormatAltitudeString(char * buff, int altitude)
{
const int alt = osdGetMetersToSelectedUnit(altitude) / 10;
tfp_sprintf(buff, "%5d", alt);
tfp_sprintf(buff, "%5d %c", alt, osdGetMetersToSelectedUnitSymbol());
buff[5] = buff[4];
buff[4] = '.';
buff[6] = osdGetMetersToSelectedUnitSymbol();
}
static void osdFormatPID(char * buff, const char * label, const pid8_t * pid)