#define MININT (1 << (sizeof(int) * 8 - 1))
-#define MAXCHUNK (-(MININT + 1)) /* Highest count we write(2). */
+#define MAXCHUNK (~MININT) /* Highest count we read(2). */
+/* Unfortunately, MAXCHUNK is too large with some compilers. Put it in
+ an int!
+*/
+
+int maxchunk = MAXCHUNK;
/*
* We don't have to worry about byte order here.
{
while (cnt) {
- register int n = cnt >= MAXCHUNK ? MAXCHUNK : cnt;
+ register int n = cnt >= maxchunk ? maxchunk : cnt;
if (read(fd, string, n) != n)
rd_fatal();
#define MININT (1 << (sizeof(int) * 8 - 1))
-#define MAXCHUNK (-(MININT + 1)) /* Highest count we write(2). */
+#define MAXCHUNK (~MININT) /* Highest count we write(2). */
+/* Notice that MAXCHUNK itself might be too large with some compilers.
+ You have to put it in an int!
+*/
+
+int maxchunk = MAXCHUNK;
/*
* Just write "cnt" bytes to file-descriptor "fd".
{
while (cnt) {
- register int n = cnt >= MAXCHUNK ? MAXCHUNK : cnt;
+ register int n = cnt >= maxchunk ? maxchunk : cnt;
if (write(fd, string, n) != n)
wr_fatal();