Browse code

core: set 'fixed' shortcut to the value for fixup_uint...

- K module expect the uint value instead of pointer to it
- reported by Juha Heinannen for nathelper module

Daniel-Constantin Mierla authored on 03/06/2009 10:02:45
Showing 1 changed files
... ...
@@ -1056,6 +1056,7 @@ int fix_param(int type, void** param)
1056 1056
 		case FPARAM_STR:
1057 1057
 			p->v.str.s = (char*)*param;
1058 1058
 			p->v.str.len = strlen(p->v.str.s);
1059
+			p->fixed = &p->v;
1059 1060
 			break;
1060 1061
 		case FPARAM_INT:
1061 1062
 			s.s = (char*)*param;
... ...
@@ -1068,11 +1069,12 @@ int fix_param(int type, void** param)
1068 1068
 				pkg_free(p);
1069 1069
 				return 1;
1070 1070
 			}
1071
+			p->fixed = (void*)(long)num;
1071 1072
 			break;
1072 1073
 		case FPARAM_REGEX:
1073 1074
 			if ((p->v.regex = pkg_malloc(sizeof(regex_t))) == 0) {
1074 1075
 				ERR("No memory left\n");
1075
-			goto error;
1076
+				goto error;
1076 1077
 			}
1077 1078
 			if (regcomp(p->v.regex, *param,
1078 1079
 						REG_EXTENDED|REG_ICASE|REG_NEWLINE)) {
... ...
@@ -1081,6 +1083,7 @@ int fix_param(int type, void** param)
1081 1081
 				ERR("Bad regular expression '%s'\n", (char*)*param);
1082 1082
 				goto error;
1083 1083
 			}
1084
+			p->fixed = &p->v;
1084 1085
 			break;
1085 1086
 		case FPARAM_AVP:
1086 1087
 			name.s = (char*)*param;
... ...
@@ -1097,6 +1100,7 @@ int fix_param(int type, void** param)
1097 1097
 				ERR("Error while parsing attribute name\n");
1098 1098
 				goto error;
1099 1099
 			}
1100
+			p->fixed = &p->v;
1100 1101
 			break;
1101 1102
 		case FPARAM_SELECT:
1102 1103
 			name.s = (char*)*param;
... ...
@@ -1111,6 +1115,7 @@ int fix_param(int type, void** param)
1111 1111
 				ERR("Error while parsing select identifier\n");
1112 1112
 				goto error;
1113 1113
 			}
1114
+			p->fixed = &p->v;
1114 1115
 			break;
1115 1116
 		case FPARAM_SUBST:
1116 1117
 			s.s = *param;
... ...
@@ -1120,6 +1125,7 @@ int fix_param(int type, void** param)
1120 1120
 				ERR("Error while parsing regex substitution\n");
1121 1121
 				goto error;
1122 1122
 			}
1123
+			p->fixed = &p->v;
1123 1124
 			break;
1124 1125
 		case FPARAM_PVS:
1125 1126
 			name.s = (char*)*param;
... ...
@@ -1151,12 +1157,11 @@ int fix_param(int type, void** param)
1151 1151
 				ERR("bad PVE format: \"%.*s\"\n", name.len, name.s);
1152 1152
 				goto error;
1153 1153
 			}
1154
+			p->fixed = &p->v;
1154 1155
 			break;
1155 1156
 	}
1156 1157
 	
1157 1158
 	p->type = type;
1158
-	if(p->fixed==NULL)
1159
-		p->fixed = &p->v;
1160 1159
 	*param = (void*)p;
1161 1160
 	return 0;
1162 1161