summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorworo <woro@e10066b5-e1e2-0310-b819-94efdf66514b>2008-02-11 10:42:22 +0000
committerworo <woro@e10066b5-e1e2-0310-b819-94efdf66514b>2008-02-11 10:42:22 +0000
commit4ab30b19e8aea8e5d180149a1a54b2addde54b3f (patch)
tree4f4183ffb2bd3417de44a57bfb9390cc874413f7
parentc25eeebeae274fd671300c88a04fc052f46a804e (diff)
downloadvdr-plugin-muggle-4ab30b19e8aea8e5d180149a1a54b2addde54b3f.tar.gz
vdr-plugin-muggle-4ab30b19e8aea8e5d180149a1a54b2addde54b3f.tar.bz2
filling language table: truncate values from iso table if
they are too long like qaa-qtz or Official Aramaic (700-300 BCE); Imperial Aramaic (700-300 BCE) git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@1018 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r--mg_db.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mg_db.c b/mg_db.c
index 8a227d2..30b7829 100644
--- a/mg_db.c
+++ b/mg_db.c
@@ -990,9 +990,15 @@ void mgDb::FillTables()
for( int i=0; i < len; i ++ )
{
char b[600];
+ char id[4];
+ char lang[41];
+ strncpy(id,languages[i].id,3);
+ id[4]=0;
+ strncpy(lang,languages[i].name,40);
+ lang[40]=0;
sprintf(b,"INSERT INTO language (id,language) VALUES('%s',%s)",
- languages[i].id,
- mgSQLString(languages[i].name).quoted());
+ id,
+ mgSQLString(lang).quoted());
Execute(b);
}
len = sizeof( musictypes ) / sizeof( musictypes_t );