* Fix a few typos.
This commit is contained in:
parent
c97d359fe2
commit
09ac5263a7
12
sql.c
12
sql.c
@ -124,7 +124,7 @@ sql_get_int_field(sqlite3 *db, const char *fmt, ...)
|
||||
}
|
||||
|
||||
char *
|
||||
sql_get_text_field(void *dbh, const char *fmt, ...)
|
||||
sql_get_text_field(void *db, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int counter, result, len;
|
||||
@ -134,9 +134,9 @@ sql_get_text_field(void *dbh, const char *fmt, ...)
|
||||
|
||||
va_start(ap, fmt);
|
||||
|
||||
if (dbh == NULL)
|
||||
if (db == NULL)
|
||||
{
|
||||
DPRINTF(E_WARN, L_DB_SQL, "%s: dbh is NULL", __func__);
|
||||
DPRINTF(E_WARN, L_DB_SQL, "%s: db is NULL", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -144,12 +144,12 @@ sql_get_text_field(void *dbh, const char *fmt, ...)
|
||||
|
||||
//DPRINTF(E_DEBUG, L_DB_SQL, "sql: %s\n", sql);
|
||||
|
||||
switch (sqlite3_prepare_v2(dbh, sql, -1, &stmt, NULL))
|
||||
switch (sqlite3_prepare_v2(db, sql, -1, &stmt, NULL))
|
||||
{
|
||||
case SQLITE_OK:
|
||||
break;
|
||||
default:
|
||||
DPRINTF(E_ERROR, L_DB_SQL, "prepare failed: %s\n%s\n", sqlite3_errmsg, sql);
|
||||
DPRINTF(E_ERROR, L_DB_SQL, "prepare failed: %s\n%s\n", sqlite3_errmsg(db), sql);
|
||||
sqlite3_free(sql);
|
||||
return NULL;
|
||||
}
|
||||
@ -190,7 +190,7 @@ sql_get_text_field(void *dbh, const char *fmt, ...)
|
||||
break;
|
||||
|
||||
default:
|
||||
DPRINTF(E_WARN, L_DB_SQL, "%s: step failed: %s", __func__, sqlite3_errmsg);
|
||||
DPRINTF(E_WARN, L_DB_SQL, "%s: step failed: %s", __func__, sqlite3_errmsg(db));
|
||||
str = NULL;
|
||||
break;
|
||||
}
|
||||
|
@ -957,10 +957,12 @@ BrowseContentDirectory(struct upnphttp * h, const char * action)
|
||||
else
|
||||
{
|
||||
ptr = sql_get_text_field(db, "SELECT OBJECT_ID from OBJECTS"
|
||||
"where OBJECT_ID in ('1$%s', '2$%s', '3$%s')",
|
||||
" where OBJECT_ID in ('1$%s', '2$%s', '3$%s')",
|
||||
ObjectId, ObjectId, ObjectId);
|
||||
if( ptr )
|
||||
ObjectId = ptr;
|
||||
else
|
||||
ObjectId = sqlite3_mprintf("%s", ObjectId);
|
||||
}
|
||||
}
|
||||
DPRINTF(E_DEBUG, L_HTTP, "Browsing ContentDirectory:\n"
|
||||
@ -1132,7 +1134,7 @@ SearchContentDirectory(struct upnphttp * h, const char * action)
|
||||
else
|
||||
{
|
||||
ptr = sql_get_text_field(db, "SELECT OBJECT_ID from OBJECTS"
|
||||
"where OBJECT_ID in ('1$%s', '2$%s', '3$%s')",
|
||||
" where OBJECT_ID in ('1$%s', '2$%s', '3$%s')",
|
||||
ContainerID, ContainerID, ContainerID);
|
||||
if( ptr )
|
||||
ContainerID = ptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user