Browse code

pv: use int index for looking up flag index

- some functions used for check may return negative on error

(cherry picked from commit 30359b3cfce2ce909153e06b1954778c4eababa7)

Daniel-Constantin Mierla authored on 06/12/2013 17:15:22
Showing 1 changed files
... ...
@@ -2711,12 +2711,12 @@ error:
2711 2711
 
2712 2712
 int pv_parse_flag_param(pv_spec_p sp, str *in)
2713 2713
 {
2714
-	unsigned int n;
2714
+	int n;
2715 2715
 
2716 2716
 	if(sp==NULL || in==NULL || in->len<=0)
2717 2717
 		return -1;
2718 2718
 
2719
-	if (str2int(in, &n) != 0)
2719
+	if (str2sint(in, &n) != 0)
2720 2720
 	{
2721 2721
 		if ((n = get_flag_no(in->s, in->len)) < 0)
2722 2722
 		{