summaryrefslogtreecommitdiffstats
path: root/read_functions.c
blob: d60b19e9aa2655ef6bf100290e1d3b1a18076d5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include "loans.h"

loan_type read_loan_type(char **contract_subtypes, char *lt) {
	int i = 0;
	for (i = 0; lt[i]; i++)
		if (lt[i] == ' ') lt[i] = '\0';

	for (i = 0; contract_subtypes[i]; i++)
		if (!strcmp(contract_subtypes[i], lt))
			return (loan_type)i;
	return MORTGAGE;
}