- String mask = st.nextToken(':');
- String maskChannel = st.nextToken(':');
- String level = st.nextToken(':');
- String prot = st.nextToken(':');
- String aop = st.nextToken(':');
- String expiration = st.nextToken(':');
- String password = st.rest().trim();
- if (password == "*NONE*")
- password = "";
- l.push_back(new UserListItem(mask, maskChannel, atoi(level),
- atoi(prot), atoi(aop),
- atol(expiration), password));
- line++;
- }
+
+ while (file >> temp, temp.length() != 0)
+ {
+ StringTokenizer st(temp);
+
+ if (st.count_tokens(':') != 7)
+ {
+ std::cerr << "Error when reading userlist (" << listFilename <<
+ ") line " << line << "...\n";
+ return;
+ }
+
+ String mask = st.next_token(':');
+ String maskChannel = st.next_token(':');
+ String level = st.next_token(':');
+ String prot = st.next_token(':');
+ String aop = st.next_token(':');
+ String expiration = st.next_token(':');
+ String password = Utils::trim_str (st.rest());
+
+ if (password == "*NONE*")
+ {
+ password = "";
+ }
+
+ l.push_back(new UserListItem(mask, maskChannel, atoi(level),
+ atoi(prot), atoi(aop),
+ atol(expiration), password));
+ line++;
+ }
+