*ret_time = (char *) malloc (sizeof(time_t) * 3 + 1);
if (*ret_time != NULL)
{
- sprintf(*ret_time, "%u", buf.st_mtime);
+ sprintf(*ret_time, "%u", (unsigned) buf.st_mtime);
return -2;
}
}
return NULL;
}
*display = 0;
- fgets(display, BUFSIZ, pp);
+ if(NULL == fgets(display, BUFSIZ, pp)) {
+ perror("fgets() failed to read");
+ return NULL;
+ }
while (isspace(display[strlen(display)-1]))
display[strlen(display)-1] = 0;
pclose(pp);
}
/* WARNING: depends on pointers and integers the same size */
#ifdef __LP64__
- return (NULL == ((int64_t)hit|(int64_t)posFile|(int64_t)locationIdList)) ? -1 : 0;
+ return (0 == ((int64_t)hit|(int64_t)posFile|(int64_t)locationIdList)) ? -1 : 0;
#else
return (0 == ((int)hit|(int)posFile|(int)locationIdList)) ? -1 : 0;
#endif
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
+#include <stdint.h>
#include <unistd.h>
#include "bufioI.h"
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
-#define FileDes(f) ((int) (f)->hidden)
+#define FileDes(f) ((intptr_t) (f)->hidden)
#define CompressFileDes(f) (((CECompressInfoPtr) (f)->hidden)->fd)
#define CompressSize(f) (((CECompressInfoPtr) (f)->hidden)->size)
{
BufFilePtr f;
- f = _DtHelpCeBufFileCreate ((char *) fd, BufFileRawFlush, NULL, _DtHelpCeBufFileFlush);
+ f = _DtHelpCeBufFileCreate ((char *) (intptr_t) fd, BufFileRawFlush, NULL, _DtHelpCeBufFileFlush);
f->bufp = f->buffer;
f->left = BUFFILESIZE;
return f;
BufFilePtr
_DtHelpCeBufFileRdWithFd (int fd)
{
- return _DtHelpCeBufFileCreate ((char *) fd, FdRawRead, BufFileRawSkip, FdClose);
+ return _DtHelpCeBufFileCreate ((char *) (intptr_t) fd, FdRawRead, BufFileRawSkip, FdClose);
}
/*****************************************************************************