Fix iloop race when using AddCommandListener and SourceMod unloads (
bug 4077, r=pred).
5 int main(int argc, char **argv)
9 fprintf(stderr, "Usage: crc32 <file>\n");
13 FILE *fp = fopen(argv[1], "rb");
16 fprintf(stderr, "Could not open file: %s\n", argv[1]);
20 fseek(fp, 0, SEEK_END);
21 size_t size = ftell(fp);
24 fprintf(stderr, "Cannot checksum an empty file.\n");
28 fseek(fp, 0, SEEK_SET);
30 void *buffer = malloc(size);
33 fprintf(stderr, "Unable to allocate %d bytes of memory.\n", size);
37 fread(buffer, size, 1, fp);
38 unsigned int crc32 = UTIL_CRC32(buffer, size);
42 fprintf(stdout, "%08X\n", crc32);