Просмотр исходного кода

replace sprintf with snprintf (#5382)

pull/5384/head
Connor O'Connor 2 месяцев назад
committed by GitHub
Родитель
Сommit
944567651c
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: B5690EEEBB952194
2 измененных файлов: 2 добавлений и 2 удалений
  1. +1
    -1
      src/rcore.c
  2. +1
    -1
      src/rtext.c

+ 1
- 1
src/rcore.c Просмотреть файл

@ -4313,7 +4313,7 @@ const char *TextFormat(const char *text, ...)
{
// Inserting "..." at the end of the string to mark as truncated
char *truncBuffer = buffers[index] + MAX_TEXT_BUFFER_LENGTH - 4; // Adding 4 bytes = "...\0"
sprintf(truncBuffer, "...");
snprintf(truncBuffer, 4, "...");
}
index += 1; // Move to next buffer for next function call

+ 1
- 1
src/rtext.c Просмотреть файл

@ -1529,7 +1529,7 @@ const char *TextFormat(const char *text, ...)
{
// Inserting "..." at the end of the string to mark as truncated
char *truncBuffer = buffers[index] + MAX_TEXT_BUFFER_LENGTH - 4; // Adding 4 bytes = "...\0"
sprintf(truncBuffer, "...");
snprintf(truncBuffer, 4, "...");
}
index += 1; // Move to next buffer for next function call

Загрузка…
Отмена
Сохранить