parse("hash", 10);
if (p - buffer != RNET_HEADER_HEAD_2014) {
- fprintf(stderr, "RNET_HEADER_HEAD_2014 in decfile.h needs to be adjusted to %li\n", p - buffer);
+ fprintf(stderr, "RNET_HEADER_HEAD_2014 in decfile.h needs to be adjusted to %ti\n", p - buffer);
goto out_val;
}
if (*p++ != '\r') {
fprintf(stderr,
- "missing CR at the %lith header character\n",
+ "missing CR at the %tith header character\n",
p - buffer);
goto out_val;
} else if (*p++ != '\n') {
fprintf(stderr,
- "missing LF at the %lith header character\n",
+ "missing LF at the %tith header character\n",
p - buffer);
goto out_val;
} else if (*p != 0) {
fprintf(stderr,
- "missing NUL at the %lith header character\n",
+ "missing NUL at the %tith header character\n",
p - buffer);
goto out_val;
} else if (p - buffer != RNET_HEADER_SIZE_2014) {
- fprintf(stderr, "RNET_HEADER_SIZE_2014 in decfile.h needs to be adjusted to %li,\nor parse_header in decfile.c needs updating\n", p - buffer);
+ fprintf(stderr, "RNET_HEADER_SIZE_2014 in decfile.h needs to be adjusted to %ti,\nor parse_header in decfile.c needs updating\n", p - buffer);
goto out_val;
} else if (p - tail != RNET_HEADER_TAIL_2014) {
- fprintf(stderr, "RNET_HEADER_TAIL_2014 in decfile.h needs to be adjusted to %li\n", p - tail);
+ fprintf(stderr, "RNET_HEADER_TAIL_2014 in decfile.h needs to be adjusted to %ti\n", p - tail);
goto out_val;
}
parse("hash", 10);
if (p - buffer != RNET_HEADER_HEAD_2013) {
- fprintf(stderr, "RNET_HEADER_HEAD_2013 in decfile.h needs to be adjusted to %li\n", p - buffer);
+ fprintf(stderr, "RNET_HEADER_HEAD_2013 in decfile.h needs to be adjusted to %ti\n", p - buffer);
goto out_val;
}
if (*p++ != '\r') {
fprintf(stderr,
- "missing CR at the %lith header character\n",
+ "missing CR at the %tith header character\n",
p - buffer);
goto out_val;
} else if (*p++ != '\n') {
fprintf(stderr,
- "missing LF at the %lith header character\n",
+ "missing LF at the %tith header character\n",
p - buffer);
goto out_val;
} else if (*p != 0) {
fprintf(stderr,
- "missing NUL at the %lith header character\n",
+ "missing NUL at the %tith header character\n",
p - buffer);
goto out_val;
} else if (p - buffer != RNET_HEADER_SIZE_2013) {
- fprintf(stderr, "RNET_HEADER_SIZE_2013 in decfile.h needs to be adjusted to %li,\nor parse_header in decfile.c needs updating\n", p - buffer);
+ fprintf(stderr, "RNET_HEADER_SIZE_2013 in decfile.h needs to be adjusted to %ti,\nor parse_header in decfile.c needs updating\n", p - buffer);
goto out_val;
} else if (p - tail != RNET_HEADER_TAIL_2013) {
- fprintf(stderr, "RNET_HEADER_TAIL_2013 in decfile.h needs to be adjusted to %li\n", p - tail);
+ fprintf(stderr, "RNET_HEADER_TAIL_2013 in decfile.h needs to be adjusted to %ti\n", p - tail);
goto out_val;
}
int pmhash_add(struct pmhash **pmhash, char *key, void *val)
{
- int i;
+ unsigned int i;
struct pmhash *hash = *pmhash;
i = 0;
repeat:
void * pmhash_get(struct pmhash *pmhash, char *key)
{
- int i;
+ unsigned int i;
for (i = 0; i < pmhash->len; i++) {
if (pmhash->items[i].key == NULL)
return NULL;
void pmhash_del(struct pmhash *pmhash)
{
- int i;
+ unsigned int i;
for (i = 0; i < pmhash->len; i++) {
if (pmhash->items[i].key == NULL)
break;
This chunk size worked at the first try, uploading a
~100KiB file, so let's stick with it. */
- const int maxc = 64472;
+ const unsigned int maxc = 64472;
if (header && len > maxc)
return -1;
int fd;
char cwd[PATH_MAX];
char *path, *fname, *tmp;
- size_t fname_len, r;
+ size_t fname_len;
+ ssize_t r;
/* If the user provided the output directory where she wishes
to save the receipt, then we use it. Otherwise, we save
the file in the current working directory (CWD). */
}
do {
r = write(fd, buffer, len);
- } while (r != len && errno == EAGAIN);
+ } while (r < 0 && errno == EAGAIN);
if (r != len)
fprintf(stderr, "Could not write to receipt file: %s", strerror(errno));
else