Quote plugin caused crash if the file was empty. Fixed.

This commit is contained in:
Kimmo Pekkola 2009-07-27 20:06:07 +00:00
parent 1dbfc85b01
commit b5618bfb92

View File

@ -245,6 +245,8 @@ double Update2(UINT id)
fseek(file, 0, SEEK_END);
int size = ftell(file);
if (size > 0)
{
// Go to a random place
int pos = rand() % size;
fseek(file, (pos / 2) * 2, SEEK_SET);
@ -394,6 +396,7 @@ double Update2(UINT id)
}
while (sepPos2 == NULL);
}
}
fclose(file);
}