rem: update_vals[0].val.str_val = pstate_name[_p->state];
add: update_vals[0].val.str_val.s = pstate_name[_p->state].s; update_vals[0].val.str_val.len = strlen(pstate_name[_p->state].s);
context: int db_update_presentity(presentity_t* _p){	if (use_db) {		db_key_t query_cols[1];		db_op_t query_ops[1];		db_val_t query_vals[1];		int n_selectors = sizeof(query_cols)/sizeof(db_key_t);		db_key_t update_cols[3];		db_val_t update_vals[3];		int n_updates = 1;		LOG(L_INFO, "update_presentity starting\n");		query_cols[0] = "uri";		query_ops[0] = OP_EQ;		query_vals[0].type = DB_STR;		query_vals[0].nul = 0;		query_vals[0].val.str_val = _p->uri;		update_cols[0] = "basic";		update_vals[0].type = DB_STR;		update_vals[0].nul = 0;		update_vals[0].val.str_val = pstate_name[_p->state];		if (_p->location.len && _p->location.s) {			update_cols[n_updates] = "location";			update_vals[n_updates].type = DB_STR;			update_vals[n_updates].nul = 0;			update_vals[n_updates].val.str_val = _p->location;			LOG(L_INFO, "  location=%s len=%d\n", _p->location.s, _p->location.len);						n_updates++;		}		db_use_table(pa_db, presentity_table);		LOG(L_INFO, "n_selectors=%d, n_updates=%d dbf.update=%p\n", 		    n_selectors, n_updates, dbf.update);		if (db_update(pa_db, 			      query_cols, query_ops, query_vals, 			      update_cols, update_vals, n_selectors, n_updates) < 0) {			LOG(L_ERR, "db_update_presentity: Error while updating database\n");			return -1;		}		LOG(L_INFO, "update_presentity done\n");	}	return 0;}