return ret;
}
-static int get_nth_score(unsigned n, long *score)
-{
- struct osl_row *row;
- int ret = osl(osl_get_nth_row(score_table, SCORECOL_SCORE, n, &row));
-
- if (ret < 0)
- return ret;
- return get_score_of_row(row, score);
-}
-
/**
* Replace a row of the score table.
*
*/
int score_update(const struct osl_row *aft_row, long percent)
{
- struct osl_row *row;
+ struct osl_row *row, *rrow; /* score row, reference row */
long new_score;
unsigned n, new_pos;
struct osl_object obj = {.data = (struct osl_row *)aft_row,
if (ret < 0)
return ret;
new_pos = 1 + (n - 1) * percent / 100;
- ret = get_nth_score(new_pos, &new_score);
+ ret = osl(osl_get_nth_row(score_table, SCORECOL_SCORE, new_pos, &rrow));
+ if (ret < 0)
+ return ret;
+ ret = get_score_of_row(rrow, &new_score);
if (ret < 0)
return ret;
new_score--;