From 0a1c3a3b17df6725dbef365f4b187dc938b707c2 Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Sat, 28 Aug 2010 08:01:51 +0000 Subject: [PATCH] * Minor code simplification. --- upnphttp.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/upnphttp.c b/upnphttp.c index 4d51a74..038f27e 100644 --- a/upnphttp.c +++ b/upnphttp.c @@ -1771,17 +1771,11 @@ SendResp_dlnafile(struct upnphttp * h, char * object) if( h->reqflags & FLAG_CAPTION ) { - sprintf(sql_buf, "SELECT 1 from CAPTIONS where ID = '%lld'", id); - ret = sql_get_table(db, sql_buf, &result, &rows, NULL); - if( ret == SQLITE_OK ) + if( sql_get_int_field(db, "SELECT ID from CAPTIONS where ID = '%lld'", id) > 0 ) { - if( rows ) - { - sprintf(hdr_buf, "CaptionInfo.sec: http://%s:%d/Captions/%lld.srt\r\n", - lan_addr[0].str, runtime_vars.port, id); - strcat(header, hdr_buf); - } - sqlite3_free_table(result); + sprintf(hdr_buf, "CaptionInfo.sec: http://%s:%d/Captions/%lld.srt\r\n", + lan_addr[0].str, runtime_vars.port, id); + strcat(header, hdr_buf); } }