load dbd file only if not empty

This commit is contained in:
zimoch
2007-10-03 14:24:09 +00:00
parent 66803b9c8c
commit 2345dfd689
+2 -2
View File
@@ -154,9 +154,9 @@ int require(char* lib, char* version)
loaded = getLibVersion(lib);
/* load dbd file */
if (stat(dbdname, &filestat) != ERROR)
if (stat(dbdname, &filestat) != ERROR && filestat.st_size > 0)
{
/* If file exists */
/* If file exists and is not empty */
printf("Loading %s\n", dbdname);
if (dbLoadDatabase(dbdname, NULL, NULL) != OK)
{