Incidencia #45985

sdl2: 'count' in popup_diplomatic_objects() unsigned

Abrir Fecha: 2022-10-27 10:27 Última actualización: 2022-11-06 00:56

Informador:
Propietario:
Tipo:
Estado:
Cerrado
Componente:
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Fixed
Fichero:
2

Details

To human eye, 'count' in popup_diplomatic_objects() is clearly always positive (initialized as 0, and ever only increased by 1). Clang analyzer seems to fail realize that, as it gives warning about division by zero that could happen only if 'count < 0' (count must be smaller than the divider). Formally declaring 'count' unsigned makes the warning to go away.

Ticket History (3/5 Histories)

2022-10-27 10:27 Updated by: cazfi
  • New Ticket "sdl2: 'count' in popup_diplomatic_objects() unsigned" created
2022-10-30 04:08 Updated by: cazfi
  • Propietario Update from (Ninguno) to cazfi
  • Resolución Update from Ninguno to Accepted
Comentario

Attached patches touch a couple of other variables too (size, width and height, related ones)

2022-11-06 00:56 Updated by: cazfi
  • Estado Update from Open to Cerrado
  • Resolución Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Entrar