summarylogtreecommitdiffstats
path: root/0006-Fix-for-tool-Munch-when-compiling-with-Mingw64-for-6.patch
blob: 983284f1bdc57445d9e3030e7bc37a540cfcc318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
diff -aurN 0005/src/tools/munch.cxx 0006/src/tools/munch.cxx
--- 0005/src/tools/munch.cxx
+++ 0006/src/tools/munch.cxx
@@ -839,9 +839,9 @@
   if (n > 0) {
     char* dp = (char*)memchr(mp, (int)((unsigned char)delim), n);
     if (dp) {
-      int nc;
+      ptrdiff_t nc;
       *stringp = dp + 1;
-      nc = (int)((unsigned long)dp - (unsigned long)mp);
+      nc = dp - mp;
       rv = (char*)malloc(nc + 1);
       if (rv) {
         memcpy(rv, mp, nc);
diff -aurN 0005/src/tools/unmunch.cxx 0006/src/tools/unmunch.cxx
--- 0005/src/tools/unmunch.cxx
+++ 0006/src/tools/unmunch.cxx
@@ -516,9 +516,9 @@
   if (n > 0) {
     char* dp = (char*)memchr(mp, (int)((unsigned char)delim), n);
     if (dp) {
-      int nc;
+      ptrdiff_t nc;
       *stringp = dp + 1;
-      nc = (int)((unsigned long)dp - (unsigned long)mp);
+      nc = dp - mp;
       rv = (char*)malloc(nc + 1);
       if (rv) {
         memcpy(rv, mp, nc);