mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 11:18:30 +00:00
Refactor and improve CTL and other code
This commit is contained in:
parent
1d8f37a2f0
commit
9906f299bb
25 changed files with 5768 additions and 5350 deletions
|
@ -16,11 +16,10 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/stdckdint.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "net/http/http.h"
|
||||
|
||||
#define MAXIMUM (1024L * 1024L * 1024L * 1024L)
|
||||
|
||||
/**
|
||||
* Parses Content-Length header.
|
||||
*
|
||||
|
@ -41,7 +40,7 @@ int64_t ParseContentLength(const char *s, size_t n) {
|
|||
return -1;
|
||||
r *= 10;
|
||||
r += s[i] - '0';
|
||||
if (r >= MAXIMUM)
|
||||
if (r > 0x000000ffffffffff)
|
||||
return -1;
|
||||
}
|
||||
return r;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue