aboutsummaryrefslogtreecommitdiff
path: root/util.c
blob: bd3f71f3610a77d85ad392670ce57d0af54d5d85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <math.h>
#include <string.h>

#include "util.h"

float pressure_to_metres_asl(float real, float setting)
{
	return 44330.f*(1.f-pow(real/setting, 1/5.255));
}

void blank_to_eol(char *line, size_t len)
{
	size_t i = 0;
	for (i = strlen(line); i < len - 1; i++) {
		line[i] = ' ';
	}
	line[i] = '\0';
}