mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Quote plugin caused crash if the file was empty. Fixed.
This commit is contained in:
parent
1dbfc85b01
commit
b5618bfb92
@ -245,6 +245,8 @@ double Update2(UINT id)
|
|||||||
fseek(file, 0, SEEK_END);
|
fseek(file, 0, SEEK_END);
|
||||||
int size = ftell(file);
|
int size = ftell(file);
|
||||||
|
|
||||||
|
if (size > 0)
|
||||||
|
{
|
||||||
// Go to a random place
|
// Go to a random place
|
||||||
int pos = rand() % size;
|
int pos = rand() % size;
|
||||||
fseek(file, (pos / 2) * 2, SEEK_SET);
|
fseek(file, (pos / 2) * 2, SEEK_SET);
|
||||||
@ -394,6 +396,7 @@ double Update2(UINT id)
|
|||||||
}
|
}
|
||||||
while (sepPos2 == NULL);
|
while (sepPos2 == NULL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user