X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/94ed11aed11d6eae5797205bd808efddd32778e7..9c340da9ffa670c20c3658a2be43d35868a9f5d9:/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp b/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp index 519074b1..bde1db80 100644 --- a/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp +++ b/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp @@ -15,7 +15,7 @@ */ /* - * Author : Maxim Mamontov + * Author : Maksym Mamontov */ /* @@ -954,26 +954,22 @@ if (PQresultStatus(result) != PGRES_TUPLES_OK) tuples = PQntuples(result); -conf->ips.Erase(); +USER_IPS ips; for (int i = 0; i < tuples; ++i) { - IP_MASK ipm; + IP_MASK im; - int ip, mask; + im.ip = inet_strington(PQgetvalue(result, i, 0)); - ip = inet_strington(PQgetvalue(result, i, 0)); - - if (str2x(PQgetvalue(result, i, 1), mask)) + if (str2x(PQgetvalue(result, i, 1), im.mask)) { printfd(__FILE__, "POSTGRESQL_STORE::RestoreUserConf(): 'Failed to fetch mask'\n"); continue; } - ipm.ip = ip; - ipm.mask = mask; - - conf->ips.Add(ipm); + ips.Add(im); } +conf->ips = ips; PQclear(result);