summaryrefslogtreecommitdiff
path: root/util/sbase/libutil/linecmp.c
blob: 08fc0e3abbacea81653e0580cbe9ad855013ce18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include <string.h>

#include "../text.h"
#include "../util.h"

int
linecmp(struct line *a, struct line *b)
{
	int res = 0;

	if (!(res = memcmp(a->data, b->data, MIN(a->len, b->len))))
		res = a->len - b->len;

	return res;
}