summaryrefslogtreecommitdiff
path: root/Build/source/utils/t1utils/TLpatches/patch-03-warnings
blob: d76b3deb92460bc73889cd1f4127f7291412568d (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff -ur t1utils-1.42/clp.c t1utils-src/clp.c
--- t1utils-1.42/clp.c	Wed Oct 28 00:08:00 2020
+++ t1utils-src/clp.c	Sat Oct 31 13:01:47 2020
@@ -1095,22 +1095,28 @@
 parse_int(Clp_Parser* clp, const char* arg, int complain, void* user_data)
 {
     const char *val;
+    char *temp;
     uintptr_t type = (uintptr_t) user_data;
     if (*arg == 0 || isspace((unsigned char) *arg)
 	|| ((type & 1) && *arg == '-'))
 	val = arg;
     else if (type & 1) { /* unsigned */
 #if HAVE_STRTOUL
-	clp->val.ul = strtoul(arg, (char **) &val, 0);
+	clp->val.ul = strtoul(arg, &temp, 0);
+	val = temp;
 #else
 	/* don't bother really trying to do it right */
 	if (arg[0] == '-')
 	    val = arg;
-	else
-	    clp->val.l = strtol(arg, (char **) &val, 0);
+	else {
+	    clp->val.l = strtol(arg, &temp, 0);
+	    val = temp;
+	}
 #endif
-    } else
-	clp->val.l = strtol(arg, (char **) &val, 0);
+    } else {
+	clp->val.l = strtol(arg, &temp, 0);
+	val = temp;
+    }
     if (type <= 1)
         clp->val.u = (unsigned) clp->val.ul;
     if (*arg != 0 && *val == 0)
@@ -1130,11 +1136,14 @@
 parse_double(Clp_Parser *clp, const char *arg, int complain, void *user_data)
 {
     const char *val;
+    char *temp;
     (void)user_data;
     if (*arg == 0 || isspace((unsigned char) *arg))
 	val = arg;
-    else
-	clp->val.d = strtod(arg, (char **) &val);
+    else {
+	clp->val.d = strtod(arg, &temp);
+	val = temp;
+    }
     if (*arg != 0 && *val == 0)
 	return 1;
     else {