Commit 0127d3c7 authored by Committed by Ludovic Rousseau
Simclist: avoid to divide by zero in list_findpos()
A division by zero with float is undefined in C. For example gcc 6.3.0 reports (when detected): dividebyzero.c:5:20: warning: division by zero [-Wdiv-by-zero] float a = (float)1/0; But the code does NOT crash. The value of a is just infinity. The problem is when Free Pascal runtime is used. In this case the code crashed.
Showing with 4 additions and 1 deletion