diff --git a/src/internal/common.h b/src/internal/common.h index 4f0531e..f44ac05 100644 --- a/src/internal/common.h +++ b/src/internal/common.h @@ -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 { diff --git a/src/types.c b/src/types.c index e641a0a..34125f1 100644 --- a/src/types.c +++ b/src/types.c @@ -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]; }