@@ -21,8 +21,8 @@ void* sqlite3_open_idr(const char *filename){
2121 int res =sqlite3_open(filename,&db);
2222
2323 if(res != SQLITE_OK){
24−
2524 printf("Error occured while opening the databse.");
25+ return NULL;
2626 }
2727 DBinfo *dbi = malloc(sizeof(DBinfo));
2828 dbi->db_ptr = db;
@@ -209,8 +209,8 @@ int sqlite3_get_val_int(void* p,const char* tbl_name, int nRow, int nCol){
209209
210210 }
211211
212− rc =sqlite3_column_int(stmt, nCol);
213− printf("int_val : %d\n", rc );
212+ val =sqlite3_column_int(stmt, nCol);
213+ printf("int_val : %d\n", val );
214214 rc =sqlite3_finalize(stmt);
215215 if( rc != SQLITE_OK){
216216 printf("Couldnt finalize:\n");
@@ -236,8 +236,8 @@ const unsigned char* sqlite3_get_val_text(void* p,const char* tbl_name,int nRow,
236236
237237 rc = sqlite3_prepare_v2(dbi->db_ptr, sql_query_buffer, -1, &stmt, &tail);
238238 if(rc != SQLITE_OK){
239− fprintf(stderr, "SQL Prepare error");
240−
239+ fprintf(stderr, "SQL Prepare error\n");
240+ return NULL;
241241 }
242242 rc = sqlite3_step(stmt);
243243
@@ -273,7 +273,7 @@ float sqlite3_get_float(void* p,const char* tbl_name, int nRow, int nCol){
273273
274274 rc = sqlite3_prepare_v2(dbi->db_ptr, sql_query_buffer, -1, &stmt, &tail);
275275 if(rc != SQLITE_OK){
276− fprintf(stderr, "SQL Prepare error");
276+ fprintf(stderr, "SQL Prepare error\n");
277277
278278 }
279279 rc = sqlite3_step(stmt);