refactor(types): add checks
This commit is contained in:
@@ -23,7 +23,7 @@ struct memory_buffer {
|
||||
typedef struct tgbot {
|
||||
char token[TOKEN_SIZE]; /**< Bot token. */
|
||||
char api[API_SIZE]; /**< Bot API url. */
|
||||
int32_t offset; /**< Bot offset. */
|
||||
int64_t offset; /**< Bot offset. */
|
||||
} tgbot_s;
|
||||
|
||||
enum tgbot_opt_type {
|
||||
|
||||
@@ -29,6 +29,10 @@ void tgbot_inlinekb_free(tgbot_inlinekeyboard_s *keyboard) {
|
||||
}
|
||||
|
||||
tgbot_inlinekeyboardbutton_s *tgbot_inlinekb_button_at(tgbot_inlinekeyboard_s *keyboard, size_t row, size_t column) {
|
||||
if (row >= keyboard->rows || column >= keyboard->columns) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &keyboard->buttons[row * keyboard->columns + column];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user