fix for asmconv - stop translating after .sect .end.
[minix.git] / commands / autil / rd_bytes.c
blobd3554a392436c243bebad9e4cb123f7b2f5fe1fd
1 /* $Id$ */
2 /*
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 */
7 #include "obj.h"
9 #define MININT (1 << (sizeof(int) * 8 - 1))
10 #define MAXCHUNK (~MININT) /* Highest count we read(2). */
11 /* Unfortunately, MAXCHUNK is too large with some compilers. Put it in
12 an int!
15 static int maxchunk = MAXCHUNK;
18 * We don't have to worry about byte order here.
19 * Just read "cnt" bytes from file-descriptor "fd".
21 void
22 rd_bytes(fd, string, cnt)
23 register char *string;
24 register long cnt;
27 while (cnt) {
28 register int n = cnt >= maxchunk ? maxchunk : cnt;
30 if (read(fd, string, n) != n)
31 rd_fatal();
32 string += n;
33 cnt -= n;