Thread: ioShareDB
View Single Post
Old 12-11-2003, 05:06 PM  
ZodMan
Junior Member
 
Join Date: Oct 2003
Posts: 6
Default

The module is already padding the array

Code:
ZeroMemory(lpUserFile->Groups, sizeof(lpUserFile->Groups));
ZeroMemory(tszGroupName, sizeof(tszGroupName));
for (iGroup = 0; (sReturn = SQLFetch(hStmt)) != SQL_NO_DATA;) // iGroup++ is here in v0.9.0
{
	if (iGroup >= MAX_GROUPS || (sReturn != SQL_SUCCESS && sReturn != SQL_SUCCESS_WITH_INFO)) break;

	lpUserFile->Groups[iGroup] = lpGroup2Gid(tszGroupName);
	if (lpUserFile->Groups[iGroup] == INVALID_GROUP)
		//lpPutlog(LOG_DEBUG, _T("ioShareDB: Cannot resolve group '%s' to an id for user '%s'\r\n"), tszGroupName, tszUserName);
	else
		iGroup++;
	ZeroMemory(tszGroupName, sizeof(tszGroupName));
}
SQLCloseCursor(hStmt);
if (iGroup == 0) { lpUserFile->Groups[0] = NOGROUP_ID; lpUserFile->Groups[1] = INVALID_GROUP; } // this line is missing in v0.9.0
else if (iGroup < MAX_GROUPS) lpUserFile->Groups[iGroup] = INVALID_GROUP;
lpUserFile->Gid = lpUserFile->Groups[0];
Can't find anything wrong so my guess is that it was NOGROUP_ID that caused the error
ZodMan is offline   Reply With Quote