Windows: change thyper to offset and fix error
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 19 Apr 2011 17:17:56 +0000 (13:17 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Fri, 22 Apr 2011 01:17:48 +0000 (18:17 -0700)
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: If60669d850f4bfba2aae6e4aaf642f7ec6f920b2
Reviewed-on: http://gerrit.openafs.org/4501
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_vnodeops.c

index 90f6800..f1a98be 100644 (file)
@@ -849,11 +849,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;
 
@@ -868,8 +868,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;
@@ -1726,11 +1726,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;
 
@@ -1744,9 +1744,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:")) )