Index: libfdproto/dictionary.c
===================================================================
--- libfdproto/dictionary.c	(revision 764)
+++ libfdproto/dictionary.c	(revision 769)
@@ -1841,5 +1841,5 @@
 All returned list must be accessed like this:
 
-  for (li = sentinel->next; li=li->next; li != sentinel) {
+  for (li = sentinel->next; li != sentinel; li=li->next) {
 	struct dict_object * obj = li->o;
 	...
@@ -1854,10 +1854,10 @@
      You must resolve them separatly with dict_search.
 		
-TYPE_BY_NAME : (parent = dictionary) returns list of types ordered by name
-ENUMVAL_BY_NAME : (parent = type object) return list of constants for this type ordered by name
+TYPE_BY_NAME : (parent = dictionary) returns list of types ordered by name (osstring order)
+ENUMVAL_BY_NAME : (parent = type object) return list of constants for this type ordered by name (osstring order)
 ENUMVAL_BY_VALUE : (parent = type object) return list of constants for this type ordered by values
-AVP_BY_NAME : (parent = vendor object) return list of AVP for this vendor ordered by name
+AVP_BY_NAME : (parent = vendor object) return list of AVP for this vendor ordered by name (osstring order)
 AVP_BY_CODE : (parent = vendor object) return list of AVP for this vendor ordered by code
-CMD_BY_NAME : (parent = dictionary) returns list of commands ordered by name
+CMD_BY_NAME : (parent = dictionary) returns list of commands ordered by name (osstring order)
 CMD_BY_CODE_R : (parent = dictionary) returns list of commands ordered by code
 RULE_BY_AVP_AND_PARENT: (parent = command or grouped AVP object) return list of rules for this object ordered by AVP vendor/code
@@ -1865,5 +1865,5 @@
 All other criteria are rejected.
  */
-int fd_dict_getlistof(int criteria, void * parent, struct fd_list * sentinel)
+int fd_dict_getlistof(int criteria, void * parent, struct fd_list ** sentinel)
 {
 	struct dictionary * dict = parent;
@@ -1877,45 +1877,45 @@
 		case VENDOR_BY_ID: /* parent must be the dictionary */
 			CHECK_PARAMS(dict->dict_eyec == DICT_EYECATCHER);
-			sentinel = &dict->dict_vendors.list[0];
+			*sentinel = &dict->dict_vendors.list[0];
 			break;
 			
 		case APPLICATION_BY_ID: /* parent must be the dictionary */
 			CHECK_PARAMS(dict->dict_eyec == DICT_EYECATCHER);
-			sentinel = &dict->dict_applications.list[0];
+			*sentinel = &dict->dict_applications.list[0];
 			break;
 			
 		case TYPE_BY_NAME: /* parent must be the dictionary */
 			CHECK_PARAMS(dict->dict_eyec == DICT_EYECATCHER);
-			sentinel = &dict->dict_types;
+			*sentinel = &dict->dict_types;
 			break;
 			
 		case ENUMVAL_BY_NAME: /* parent must be a type object */
 			CHECK_PARAMS(verify_object(obj_parent) && (obj_parent->type == DICT_TYPE));
-			sentinel = &obj_parent->list[1];
+			*sentinel = &obj_parent->list[1];
 			break;
 			
 		case ENUMVAL_BY_VALUE: /* parent must be a type object */
 			CHECK_PARAMS(verify_object(obj_parent) && (obj_parent->type == DICT_TYPE));
-			sentinel = &obj_parent->list[2];
-			break;
-			
-		case AVP_BY_NAME: /* parent must be a AVP object */
-			CHECK_PARAMS(verify_object(obj_parent) && (obj_parent->type == DICT_AVP));
-			sentinel = &obj_parent->list[2];
-			break;
-			
-		case AVP_BY_CODE: /* parent must be a AVP object */
-			CHECK_PARAMS(verify_object(obj_parent) && (obj_parent->type == DICT_AVP));
-			sentinel = &obj_parent->list[1];
+			*sentinel = &obj_parent->list[2];
+			break;
+			
+		case AVP_BY_NAME: /* parent must be a VENDOR object */
+			CHECK_PARAMS(verify_object(obj_parent) && (obj_parent->type == DICT_VENDOR));
+			*sentinel = &obj_parent->list[2];
+			break;
+			
+		case AVP_BY_CODE: /* parent must be a VENDOR object */
+			CHECK_PARAMS(verify_object(obj_parent) && (obj_parent->type == DICT_VENDOR));
+			*sentinel = &obj_parent->list[1];
 			break;
 			
 		case CMD_BY_NAME: /* parent must be the dictionary */
 			CHECK_PARAMS(dict->dict_eyec == DICT_EYECATCHER);
-			sentinel = &dict->dict_cmd_name;
+			*sentinel = &dict->dict_cmd_name;
 			break;
 			
 		case CMD_BY_CODE_R: /* parent must be the dictionary */
 			CHECK_PARAMS(dict->dict_eyec == DICT_EYECATCHER);
-			sentinel = &dict->dict_cmd_code;
+			*sentinel = &dict->dict_cmd_code;
 			break;
 			
@@ -1925,5 +1925,5 @@
 					((obj_parent->type == DICT_AVP) 
 					  && (obj_parent->data.avp.avp_basetype == AVP_TYPE_GROUPED)) );
-			sentinel = &obj_parent->list[2];
+			*sentinel = &obj_parent->list[2];
 			break;
 			
