[Midnightbsd-cvs] mports [16858] trunk/Tools/magus/bless/magus-bless.cxx: use vars
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Sep 6 23:12:58 EDT 2014
Revision: 16858
http://svnweb.midnightbsd.org/mports/?rev=16858
Author: laffer1
Date: 2014-09-06 23:12:56 -0400 (Sat, 06 Sep 2014)
Log Message:
-----------
use vars
Modified Paths:
--------------
trunk/Tools/magus/bless/magus-bless.cxx
Modified: trunk/Tools/magus/bless/magus-bless.cxx
===================================================================
--- trunk/Tools/magus/bless/magus-bless.cxx 2014-09-07 03:08:33 UTC (rev 16857)
+++ trunk/Tools/magus/bless/magus-bless.cxx 2014-09-07 03:12:56 UTC (rev 16858)
@@ -159,8 +159,7 @@
printf("Load the mirrors list\n");
nontransaction Q(C);
- sprintf(query_def, "SELECT * FROM mirrors order by country");
- result R2(Q.exec(string(query_def)));
+ result R2(Q.exec("SELECT country, url FROM mirrors order by country"));
if (!R2.empty())
{
for (result::const_iterator c = R2.begin(); c != R2.end(); ++c)
@@ -171,8 +170,10 @@
{
errx(1, "Could not prepare statement");
}
- sqlite3_bind_text(stmt, 1, c[1].as(string()).c_str(), c[1].as(string()).length(), SQLITE_TRANSIENT);
- sqlite3_bind_text(stmt, 2, c[2].as(string()).c_str(), c[2].as(string()).length(), SQLITE_TRANSIENT);
+ string country = c[0].as(string());
+ string url = c[1].as(string());
+ sqlite3_bind_text(stmt, 1, country.c_str(), country.length(), SQLITE_TRANSIENT);
+ sqlite3_bind_text(stmt, 2, url.c_str(), url.length(), SQLITE_TRANSIENT);
if (sqlite3_step(stmt) != SQLITE_DONE)
errx(1,"Could not execute query");
More information about the Midnightbsd-cvs
mailing list