misztikus closedir() hiba misztikus javitasa...

git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@961 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
drotos 2006-11-15 10:55:39 +00:00 committed by Adam Visegradi
parent 3c19b50db9
commit 1147ac8ad1
1 changed files with 3 additions and 2 deletions

View File

@ -186,7 +186,7 @@ _DC_nuof_messages(char *box, char *name)
return(0);
if ((d= opendir(box)) == NULL)
return(0);
s= malloc(100+name?strlen(name):strlen(_DCAPI_MSG_MESSAGE));
s= malloc(100 + (name?strlen(name):strlen(_DCAPI_MSG_MESSAGE)));
strcpy(s, name?name:_DCAPI_MSG_MESSAGE);
strcat(s, ".");
while ((de= readdir(d)) != NULL)
@ -195,8 +195,9 @@ _DC_nuof_messages(char *box, char *name)
if (found == de->d_name)
nuof++;
}
if (d)
closedir(d);
free(s);
closedir(d);
return(nuof);
}