register.c | register.c | |||
---|---|---|---|---|
skipping to change at line 69 | skipping to change at line 69 | |||
return (i); | return (i); | |||
} | } | |||
else | else | |||
{ | { | |||
break; | break; | |||
} | } | |||
} | } | |||
if (i <= _IceLastMajorOpcode) | if (i <= _IceLastMajorOpcode) | |||
{ | { | |||
p = _IceProtocols[i - 1].orig_client = | p = _IceProtocols[i - 1].orig_client = malloc (sizeof(_IcePoProtocol | |||
(_IcePoProtocol *) malloc (sizeof (_IcePoProtocol)); | )); | |||
opcodeRet = i; | opcodeRet = i; | |||
} | } | |||
else if (_IceLastMajorOpcode == 255 || | else if (_IceLastMajorOpcode == 255 || | |||
versionCount < 1 || | versionCount < 1 || | |||
strlen (protocolName) == 0) | strlen (protocolName) == 0) | |||
{ | { | |||
return (-1); | return (-1); | |||
} | } | |||
else | else | |||
{ | { | |||
char *name; | _IceProtocols[_IceLastMajorOpcode].protocol_name = | |||
_IceProtocols[_IceLastMajorOpcode].protocol_name = name = | ||||
strdup(protocolName); | strdup(protocolName); | |||
p = _IceProtocols[_IceLastMajorOpcode].orig_client = | p = _IceProtocols[_IceLastMajorOpcode].orig_client = | |||
(_IcePoProtocol *) malloc (sizeof (_IcePoProtocol)); | malloc (sizeof (_IcePoProtocol)); | |||
_IceProtocols[_IceLastMajorOpcode].accept_client = NULL; | _IceProtocols[_IceLastMajorOpcode].accept_client = NULL; | |||
opcodeRet = ++_IceLastMajorOpcode; | opcodeRet = ++_IceLastMajorOpcode; | |||
} | } | |||
p->vendor = strdup(vendor); | p->vendor = strdup(vendor); | |||
p->release = strdup(release); | p->release = strdup(release); | |||
p->version_count = versionCount; | p->version_count = versionCount; | |||
p->version_recs = (IcePoVersionRec *) malloc ( | p->version_recs = malloc (versionCount * sizeof (IcePoVersionRec)); | |||
versionCount * sizeof (IcePoVersionRec)); | ||||
memcpy (p->version_recs, versionRecs, | memcpy (p->version_recs, versionRecs, | |||
versionCount * sizeof (IcePoVersionRec)); | versionCount * sizeof (IcePoVersionRec)); | |||
if ((p->auth_count = authCount) > 0) | if ((p->auth_count = authCount) > 0) | |||
{ | { | |||
p->auth_names = (char **) malloc ( | p->auth_names = malloc (authCount * sizeof (char *)); | |||
authCount * sizeof (char *)); | ||||
p->auth_procs = (IcePoAuthProc *) malloc ( | p->auth_procs = malloc (authCount * sizeof (IcePoAuthProc)); | |||
authCount * sizeof (IcePoAuthProc)); | ||||
for (i = 0; i < authCount; i++) | for (i = 0; i < authCount; i++) | |||
{ | { | |||
p->auth_names[i] = strdup(authNames[i]); | p->auth_names[i] = strdup(authNames[i]); | |||
p->auth_procs[i] = authProcs[i]; | p->auth_procs[i] = authProcs[i]; | |||
} | } | |||
} | } | |||
else | else | |||
{ | { | |||
p->auth_names = NULL; | p->auth_names = NULL; | |||
skipping to change at line 167 | skipping to change at line 161 | |||
} | } | |||
else | else | |||
{ | { | |||
break; | break; | |||
} | } | |||
} | } | |||
if (i <= _IceLastMajorOpcode) | if (i <= _IceLastMajorOpcode) | |||
{ | { | |||
p = _IceProtocols[i - 1].accept_client = | p = _IceProtocols[i - 1].accept_client = | |||
(_IcePaProtocol *) malloc (sizeof (_IcePaProtocol)); | malloc (sizeof (_IcePaProtocol)); | |||
opcodeRet = i; | opcodeRet = i; | |||
} | } | |||
else if (_IceLastMajorOpcode == 255 || | else if (_IceLastMajorOpcode == 255 || | |||
versionCount < 1 || | versionCount < 1 || | |||
strlen (protocolName) == 0) | strlen (protocolName) == 0) | |||
{ | { | |||
return (-1); | return (-1); | |||
} | } | |||
else | else | |||
{ | { | |||
char *name; | _IceProtocols[_IceLastMajorOpcode].protocol_name = | |||
_IceProtocols[_IceLastMajorOpcode].protocol_name = name = | ||||
strdup(protocolName); | strdup(protocolName); | |||
_IceProtocols[_IceLastMajorOpcode].orig_client = NULL; | _IceProtocols[_IceLastMajorOpcode].orig_client = NULL; | |||
p = _IceProtocols[_IceLastMajorOpcode].accept_client = | p = _IceProtocols[_IceLastMajorOpcode].accept_client = | |||
(_IcePaProtocol *) malloc (sizeof (_IcePaProtocol)); | malloc (sizeof (_IcePaProtocol)); | |||
opcodeRet = ++_IceLastMajorOpcode; | opcodeRet = ++_IceLastMajorOpcode; | |||
} | } | |||
p->vendor = strdup(vendor); | p->vendor = strdup(vendor); | |||
p->release = strdup(release); | p->release = strdup(release); | |||
p->version_count = versionCount; | p->version_count = versionCount; | |||
p->version_recs = (IcePaVersionRec *) malloc ( | p->version_recs = malloc (versionCount * sizeof (IcePaVersionRec)); | |||
versionCount * sizeof (IcePaVersionRec)); | ||||
memcpy (p->version_recs, versionRecs, | memcpy (p->version_recs, versionRecs, | |||
versionCount * sizeof (IcePaVersionRec)); | versionCount * sizeof (IcePaVersionRec)); | |||
p->protocol_setup_proc = protocolSetupProc; | p->protocol_setup_proc = protocolSetupProc; | |||
p->protocol_activate_proc = protocolActivateProc; | p->protocol_activate_proc = protocolActivateProc; | |||
if ((p->auth_count = authCount) > 0) | if ((p->auth_count = authCount) > 0) | |||
{ | { | |||
p->auth_names = (char **) malloc ( | p->auth_names = malloc (authCount * sizeof (char *)); | |||
authCount * sizeof (char *)); | ||||
p->auth_procs = (IcePaAuthProc *) malloc ( | p->auth_procs = malloc (authCount * sizeof (IcePaAuthProc)); | |||
authCount * sizeof (IcePaAuthProc)); | ||||
for (i = 0; i < authCount; i++) | for (i = 0; i < authCount; i++) | |||
{ | { | |||
p->auth_names[i] = strdup(authNames[i]); | p->auth_names[i] = strdup(authNames[i]); | |||
p->auth_procs[i] = authProcs[i]; | p->auth_procs[i] = authProcs[i]; | |||
} | } | |||
} | } | |||
else | else | |||
{ | { | |||
p->auth_names = NULL; | p->auth_names = NULL; | |||
End of changes. 12 change blocks. | ||||
23 lines changed or deleted | 13 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |