shithub: scc

ref: 560a156341e5bb352194a85c3258406a079697b7
dir: /src/libmach/findsec.c/

View raw version
#include <stdio.h>
#include <string.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;
}