shithub: scc

ref: 4a9cb6d18a8757cbf41789e38730362c4ae0797a
dir: /src/libmach/findsec.c/

View raw version
#include <stdio.h>

#include <scc/mach.h>

#include "libmach.h"

int
findsec(Map *map, char *name)
{
	int i;
	struct mapsec *sec;

	for (i = 0; i < map->n; i++) {
		char *s = map->sec[i].name;
		if (s && strcmp(s, name) == 0)
			return i;
	}

	return -1;
}