scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <stdio.h>
 2
 3#include <scc/mach.h>
 4
 5#include "libmach.h"
 6
 7int
 8copysec(Mapsec *msec, FILE *fp)
 9{
10	long n;
11	Section *sec = &msec->sec;
12
13	fseek(msec->fp, sec->offset, SEEK_SET);
14	for (n = msec->fsiz; n != 0; n--)
15		putc(getc(msec->fp), fp);
16
17	return ferror(msec->fp) ? -1 : 0;
18}