]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpImpl.c
NetworkPkg: Refine type cast for pointer subtraction
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpImpl.c
index 745832b9d0bc15f85d802a4e0ad9dc381f4d7099..1f7a4fa52a8ee36f52124942c2e958e156698a52 100644 (file)
@@ -1342,7 +1342,7 @@ HttpResponseWorker (
     // We receive part of header of next HTTP msg.\r
     //\r
     if (HttpInstance->NextMsg != NULL) {\r
-      HttpMsg->BodyLength = MIN ((UINTN) (HttpInstance->NextMsg - (CHAR8 *) Fragment.Bulk), HttpMsg->BodyLength);\r
+      HttpMsg->BodyLength = MIN ((UINTN) HttpInstance->NextMsg - (UINTN) Fragment.Bulk, HttpMsg->BodyLength);\r
       CopyMem (HttpMsg->Body, Fragment.Bulk, HttpMsg->BodyLength);\r
       \r
       HttpInstance->CacheLen = Fragment.Len - HttpMsg->BodyLength;\r
@@ -1360,7 +1360,7 @@ HttpResponseWorker (
         CopyMem (HttpInstance->CacheBody, Fragment.Bulk + HttpMsg->BodyLength, HttpInstance->CacheLen);\r
         HttpInstance->CacheOffset = 0;\r
 \r
-        HttpInstance->NextMsg = HttpInstance->CacheBody + (UINTN) (HttpInstance->NextMsg - (CHAR8 *) (Fragment.Bulk + HttpMsg->BodyLength));\r
+        HttpInstance->NextMsg = HttpInstance->CacheBody + ((UINTN) HttpInstance->NextMsg - (UINTN) (Fragment.Bulk + HttpMsg->BodyLength));\r
       }\r
     } else {\r
       HttpMsg->BodyLength = MIN (Fragment.Len, (UINT32) HttpMsg->BodyLength);\r