Commit b5845133 authored by Ralf Mueller's avatar Ralf Mueller
Browse files

fix SSIZE_MAX missing macro on jessie

parent 73c6dba4
......@@ -6,7 +6,7 @@
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdint.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
......@@ -915,7 +915,7 @@ int file_fill_buffer(bfile_t *fileptr)
}
else
{
xassert(fileptr->bufferSize <= SSIZE_MAX);
xassert(fileptr->bufferSize <= SIZE_MAX);
nread = (ssize_t)fileptr->bufferSize;
if ( (nread + fileptr->bufferPos) > fileptr->size )
nread = fileptr->size - fileptr->bufferPos;
......
......@@ -30,7 +30,7 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>
......@@ -82,7 +82,7 @@ getline(char **linebuf, size_t *linebuf_size, FILE *fp)
&& (len += strlen(buf + len)) > old_len
&& buf[len-1] != '\n');
}
status = len > SSIZE_MAX ? SSIZE_MAX : (ssize_t)len;
status = len > SIZE_MAX ? SIZE_MAX : (ssize_t)len;
}
if (linebuf_size)
*linebuf_size = buf_size;
......
......@@ -2,7 +2,7 @@
# include "config.h"
#endif
#include <limits.h>
#include <stdint.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
......@@ -340,7 +340,7 @@ scatterGatherPackFunc(void *dataDesc, void *buf, int size, int *pos,
unsigned char *dstBuf = (unsigned char *)buf + pos_,
*bufEnd = (unsigned char *)buf + size;
size_t elemSize = p->elemSize;
xassert(elemSize <= SSIZE_MAX);
xassert(elemSize <= SIZE_MAX);
const unsigned char *data = p->data;
unsigned copyCount = 0, numElems = p->numElems;
for (unsigned j = 0; j < numBlocks && copyCount < numElems; ++j)
......@@ -356,7 +356,7 @@ scatterGatherPackFunc(void *dataDesc, void *buf, int size, int *pos,
}
size_t bsize = (size_t)bl * elemSize;
xassert(dstBuf + bsize <= bufEnd);
memcpy(dstBuf, data + (ssize_t)elemSize * (ssize_t)disps[j], bsize);
memcpy(dstBuf, data + (size_t)elemSize * (size_t)disps[j], bsize);
dstBuf += bsize;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment