Skip to content
Browse files

Since bytes is unsigned, bytes >= 0 is always true. Found by clang.

  • Loading branch information...
1 parent e730914 commit c22f9323a0361033d0acbd05829c87de855fbb62 Sean MacLennan committed Mar 1, 2012
Showing with 11 additions and 17 deletions.
  1. +11 −17 http.c
View
28 http.c
@@ -615,23 +615,17 @@ static int read_chunkblock(struct connection *conn)
return 1;
}
- if (bytes >= 0) {
- conn->length -= bytes;
- if (conn->length <= 0) {
- if (verbose > 1)
- printf("Read block\n");
- conn->curp += bytes;
- conn->length = 0;
- conn->cstate = CS_START_CR;
- NEXT_STATE(conn, read_file_chunked);
- if (conn->endp > conn->curp)
- return read_file_chunked(conn);
- return 0;
- }
- } else {
- printf("Read chunk file problems %d for %s\n",
- bytes, conn->url);
- return 1;
+ conn->length -= bytes;
+ if (conn->length <= 0) {
+ if (verbose > 1)
+ printf("Read block\n");
+ conn->curp += bytes;
+ conn->length = 0;
+ conn->cstate = CS_START_CR;
+ NEXT_STATE(conn, read_file_chunked);
+ if (conn->endp > conn->curp)
+ return read_file_chunked(conn);
+ return 0;
}
conn->curp = conn->buf;

0 comments on commit c22f932

Please sign in to comment.
Something went wrong with that request. Please try again.