fix -N for regex filters, fix some warnings

This commit is contained in:
cathugger 2018-02-22 23:39:55 +00:00
parent 5df37bb545
commit f1f25ba2b6
3 changed files with 10 additions and 9 deletions

View file

@ -98,7 +98,7 @@ static int parsecpuinfo()
if (strcasecmp(buf,"processor") == 0 && v) {
char *endp = 0;
long n = strtol(v,&endp,10);
if (endp && endp > v && n >= 0 && n < sizeof(cpubitmap) * 8)
if (endp && endp > v && n >= 0 && (size_t)n < sizeof(cpubitmap) * 8)
cpubitmap[n / 8] |= 1 << (n % 8);
}
}