Fix OpenBSD warnings.

This commit is contained in:
John McNamara 2016-07-12 23:36:25 +01:00
parent 6777d3346e
commit fce0f891d5
2 changed files with 5 additions and 2 deletions

View File

@ -143,6 +143,9 @@ enum lxw_custom_property_types {
/* Max col string length. */
#define LXW_MAX_COL_NAME_LENGTH sizeof("$XFD")
/* Max row string length. */
#define LXW_MAX_ROW_NAME_LENGTH sizeof("$1048576")
/* Max cell string length. */
#define LXW_MAX_CELL_NAME_LENGTH sizeof("$XFWD$1048576")

View File

@ -103,7 +103,7 @@ lxw_rowcol_to_cell(char *cell_name, lxw_row_t row, lxw_col_t col)
pos = strlen(cell_name);
/* Add the row to the cell. */
sprintf(&cell_name[pos], "%d", ++row);
snprintf(&cell_name[pos], LXW_MAX_ROW_NAME_LENGTH, "%d", ++row);
}
/*
@ -126,7 +126,7 @@ lxw_rowcol_to_cell_abs(char *cell_name, lxw_row_t row, lxw_col_t col,
cell_name[pos++] = '$';
/* Add the row to the cell. */
sprintf(&cell_name[pos], "%d", ++row);
snprintf(&cell_name[pos], LXW_MAX_ROW_NAME_LENGTH, "%d", ++row);
}
/*