refactor(types): add checks

This commit is contained in:
2026-03-25 00:35:28 +01:00
parent 37ee86a1da
commit 9baf180a45
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ struct memory_buffer {
typedef struct tgbot { typedef struct tgbot {
char token[TOKEN_SIZE]; /**< Bot token. */ char token[TOKEN_SIZE]; /**< Bot token. */
char api[API_SIZE]; /**< Bot API url. */ char api[API_SIZE]; /**< Bot API url. */
int32_t offset; /**< Bot offset. */ int64_t offset; /**< Bot offset. */
} tgbot_s; } tgbot_s;
enum tgbot_opt_type { enum tgbot_opt_type {
+4
View File
@@ -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) { 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]; return &keyboard->buttons[row * keyboard->columns + column];
} }