X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fh2ext.c;h=13366df7979ce79e8857ca46a438bb16f38b7af3;hb=HEAD;hp=af1cc5ab763f8368d6582cf22fc05205c0d1af9d;hpb=d081f7a2c7a962ab3a6b65255f4be5e17cf4b276;p=util-vserver.git diff --git a/src/h2ext.c b/src/h2ext.c index af1cc5a..13366df 100644 --- a/src/h2ext.c +++ b/src/h2ext.c @@ -148,7 +148,7 @@ process_file(file_format_t *head, const char *file, file_format_t *ret[2]) fd = EopenD(file, O_RDONLY, 0); Efstat(fd, &st); mapping = mmap(NULL, MIN(st.st_size, MAX_PEEK_SIZE), PROT_READ, MAP_SHARED, fd, 0); - if (!mapping) { + if (mapping == MAP_FAILED) { perror("mmap()"); Eclose(fd); return -1; @@ -228,7 +228,7 @@ load_description(const char *file, file_format_t **head) *buf = '\0'; while (1) { - if ((eol = strchr(buf, '\n')) == NULL && (end - buf) < (sizeof(buf) - 1)) { + if ((eol = strchr(buf, '\n')) == NULL && (end - buf) < (signed) (sizeof(buf) - 1)) { bytes_read = Eread(fd, end, sizeof(buf) - 1 - (end - buf)); /* EOF, implicit newline */ if (bytes_read == 0) {