Package: scrounge-ntfs / 0.9-9

03_fix-max-size.patch Patch series | download
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Description: allow disks grather than 2TB. (Closes: #690802, LP: #1067814)
Author: doug Springer <gpib@rickyrockrat.net>
Reviewed-by: Joao Eriberto Mota Filho <eriberto@debian.org>
Last-Update: 2015-06-24
Index: scrounge-ntfs-0.9/src/main.c
===================================================================
--- scrounge-ntfs-0.9.orig/src/main.c
+++ scrounge-ntfs-0.9/src/main.c
@@ -77,7 +77,7 @@ bool g_verifyMode = false;
 int main(int argc, char* argv[])
 {
   int ch = 0;
-  int temp = 0;
+  unsigned long temp = 0;
   int mode = 0;
   int raw = 0;
   partitioninfo pi;
@@ -103,7 +103,7 @@ int main(int argc, char* argv[])
     /* cluster size */
     case 'c':
       {
-        temp = atoi(optarg);
+        temp = atol(optarg);
         
         /* TODO: Check this range */
         if(temp <= 0 || temp > 128)
@@ -118,7 +118,7 @@ int main(int argc, char* argv[])
     /* drive number */
     case 'd':
       {
-        temp = atoi(optarg);
+        temp = atol(optarg);
 
         /* TODO: Check this range */
         if(temp < 0 || temp > 128)
@@ -142,7 +142,7 @@ int main(int argc, char* argv[])
     /* mft offset */
     case 'm':
       {
-        temp = atoi(optarg);
+        temp = atol(optarg);
 
         /* TODO: Check this range */
         if(temp < 0)
@@ -217,14 +217,14 @@ int main(int argc, char* argv[])
     if(argc > 2)
       warnx("ignoring extra arguments");
 
-    temp = atoi(argv[0]);
+    temp = atol(argv[0]);
     if(temp < 0)
       errx(2, "invalid start sector (must be positive)");
 
     pi.first = temp;
 
-    temp = atoi(argv[1]);
-    if(temp < 0 || ((unsigned int)temp) <= pi.first)
+    temp = atol(argv[1]);
+    if(temp < 0 || temp <= pi.first)
       errx(2, "invalid end sector (must be positive and greater than first)");
 
     pi.end = temp;