X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/ff30f98e6a1ea1de5ed4ea69cc3552440ee7f26c..d4814561eafc238a9ed2b4fa67ef2755e5e83858:/sbr/fmt_scan.c diff --git a/sbr/fmt_scan.c b/sbr/fmt_scan.c index 091ba75d..cb29b72c 100644 --- a/sbr/fmt_scan.c +++ b/sbr/fmt_scan.c @@ -795,15 +795,18 @@ fmt_scan (struct format *format, charstring_t scanlp, int width, int *dat, value *= fmt->f_value; break; case FT_LV_DIVIDE_L: - if (fmt->f_value) - value /= fmt->f_value; - else + if (fmt->f_value == 0 || (fmt->f_value == -1 && value == INT_MIN)) { + // FIXME: Tell the user, and probably stop. value = 0; + } else { + value /= fmt->f_value; + } break; case FT_LV_MODULO_L: if (fmt->f_value) value %= fmt->f_value; else + // FIXME: Tell the user, and probably stop. value = 0; break; case FT_SAVESTR: