From: Jeffrey Altman Date: Tue, 19 Apr 2011 17:17:56 +0000 (-0400) Subject: Windows: change thyper to offset and fix error X-Git-Tag: upstream/1.6.0.pre5^2~31 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3cbd777eff4145388b6f238b5ca2e14d8ab182a5;p=packages%2Fo%2Fopenafs.git Windows: change thyper to offset and fix error In cm_ReadMountPoint and cm_HandleLink the variable 'thyper' represets the 'offset' at which cm_GetData should fetch data. Rename 'thyper' to 'offset' and fix a coding error caused by misinterpreting the variable purpose. Change-Id: Icdd2493e356803b4b2bd00c7349d8d882283d29b Reviewed-on: http://gerrit.openafs.org/4501 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman Reviewed-on: http://gerrit.openafs.org/4523 --- diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index c0e3dcc3c..e6323975a 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -846,11 +846,11 @@ long cm_ReadMountPoint(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp) #endif /* AFS_FREELANCE_CLIENT */ { char temp[MOUNTPOINTLEN]; - osi_hyper_t thyper; + osi_hyper_t offset; /* otherwise, we have to read it in */ - thyper.LowPart = thyper.HighPart = 0; - code = cm_GetData(scp, &thyper, temp, MOUNTPOINTLEN, userp, reqp); + offset.LowPart = offset.HighPart = 0; + code = cm_GetData(scp, &offset, temp, MOUNTPOINTLEN, userp, reqp); if (code) return code; @@ -865,8 +865,8 @@ long cm_ReadMountPoint(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp) return CM_ERROR_INVAL; /* convert the terminating dot to a NUL */ - temp[thyper.LowPart - 1] = 0; - memcpy(scp->mountPointStringp, temp, thyper.LowPart); + temp[scp->length.LowPart - 1] = 0; + memcpy(scp->mountPointStringp, temp, scp->length.LowPart); } return code; @@ -1723,11 +1723,11 @@ long cm_HandleLink(cm_scache_t *linkScp, cm_user_t *userp, cm_req_t *reqp) #endif /* AFS_FREELANCE_CLIENT */ { char temp[MOUNTPOINTLEN]; - osi_hyper_t thyper; + osi_hyper_t offset; /* read the link data from the file server */ - thyper.LowPart = thyper.HighPart = 0; - code = cm_GetData(linkScp, &thyper, temp, MOUNTPOINTLEN, userp, reqp); + offset.LowPart = offset.HighPart = 0; + code = cm_GetData(linkScp, &offset, temp, MOUNTPOINTLEN, userp, reqp); if (code) return code; @@ -1741,9 +1741,9 @@ long cm_HandleLink(cm_scache_t *linkScp, cm_user_t *userp, cm_req_t *reqp) if (linkScp->length.LowPart == 0) return CM_ERROR_INVAL; - /* convert the terminating dot to a NUL */ - temp[thyper.LowPart - 1] = 0; - memcpy(linkScp->mountPointStringp, temp, thyper.LowPart); + /* make sure we are NUL terminated */ + temp[linkScp->length.LowPart] = 0; + memcpy(linkScp->mountPointStringp, temp, linkScp->length.LowPart + 1); } if ( !strnicmp(linkScp->mountPointStringp, "msdfs:", strlen("msdfs:")) )