Remove signed/unsigned comparisons
This commit is contained in:
parent
8bef1be5c4
commit
7666e3a99a
6
main.c
6
main.c
@ -197,7 +197,7 @@ int main(int argc, char *argv[])
|
|||||||
* so might as well start from there.
|
* so might as well start from there.
|
||||||
*/
|
*/
|
||||||
slen = n;
|
slen = n;
|
||||||
for (unsigned i = n - 2; i < n; --i) {
|
for (int i = n - 2; i >= 0; --i) {
|
||||||
if (sbuf[i] == 0x0d && sbuf[i + 1] == 0x0a)
|
if (sbuf[i] == 0x0d && sbuf[i + 1] == 0x0a)
|
||||||
slen = i;
|
slen = i;
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ int main(int argc, char *argv[])
|
|||||||
*/
|
*/
|
||||||
char *sp = sbuf;
|
char *sp = sbuf;
|
||||||
unsigned splen = 0, ppos = srvroot_len;
|
unsigned splen = 0, ppos = srvroot_len;
|
||||||
for (unsigned i = 0; i < slen; ++i) {
|
for (int i = 0; i < slen; ++i) {
|
||||||
if (sbuf[i] != '/') {
|
if (sbuf[i] != '/') {
|
||||||
++splen;
|
++splen;
|
||||||
continue;
|
continue;
|
||||||
@ -284,7 +284,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Copy from fbuf to rbuf, replacing LF with CRLF. */
|
/* Copy from fbuf to rbuf, replacing LF with CRLF. */
|
||||||
for (unsigned fpos = 0; fpos < n; ++fpos) {
|
for (int fpos = 0; fpos < n; ++fpos) {
|
||||||
if (fbuf[fpos] == '\n') {
|
if (fbuf[fpos] == '\n') {
|
||||||
if (RBUF_SIZE - rlen < 2) {
|
if (RBUF_SIZE - rlen < 2) {
|
||||||
fprintf(stderr, "Response buffer is too small");
|
fprintf(stderr, "Response buffer is too small");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user