mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
Fix numeric overflow
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include "memfile.hpp"
|
||||
#include "pool.hpp"
|
||||
|
||||
#define POOL_WIDTH 256
|
||||
|
||||
static int hash(const char *s) {
|
||||
int h = 0;
|
||||
unsigned h = 0;
|
||||
for (; *s; s++) {
|
||||
h = h * 37 + *s;
|
||||
h = (h * 37 + *s) & ULONG_MAX;
|
||||
}
|
||||
h = h & 0xFF;
|
||||
return h;
|
||||
return h & 0xFF;
|
||||
}
|
||||
|
||||
struct pool_val *pool(struct pool *p, const char *s, int type) {
|
||||
|
||||
Reference in New Issue
Block a user