aboutsummaryrefslogtreecommitdiff
path: root/system/reiser4progs/fix_libreiser4_linking.diff
blob: 748c3da21c808df5cd0f29fbedf972acc8818db3 (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
diff -Naur reiser4progs-1.1.0/libreiser4/profile.c reiser4progs-1.1.0.patched/libreiser4/profile.c
--- reiser4progs-1.1.0/libreiser4/profile.c	2015-08-23 13:13:59.000000000 -0400
+++ reiser4progs-1.1.0.patched/libreiser4/profile.c	2017-02-14 16:48:03.318110246 -0500
@@ -5,7 +5,8 @@
 
 
 #include <reiser4/libreiser4.h>
-#include <misc/misc.h>
+#include <stdlib.h>
+#include <errno.h>
 
 /* All default plugin ids. This is used for getting plugin id if it cannot be
    obtained by usual way (get from disk structures, etc.). All these may be
@@ -332,6 +333,7 @@
 	reiser4_plug_t *plug;
 	long long int val;
 	uint8_t i;
+	char *error;
 	
 	aal_assert("umka-924", slot != NULL);
 	aal_assert("umka-923", name != NULL);
@@ -354,7 +356,8 @@
 	}
 	
 	if (defprof.pid[i].id.type == PARAM_PLUG_TYPE)  {
-		if ((val = misc_str2long((char *)name, 10)) == INVAL_DIG) {
+		val = strtol((char *)name, &error, 10);
+		if (errno == ERANGE || *error) {
 			aal_error("Invalid value \"%s\" is provided for the "
 				  "profile slot \"%s\".", (char *)name,
 				  defprof.pid[i].name);