- if (*ext
- && (*ext - *base) > (int) strlen (".tab")
- && (!strncmp (*ext - strlen (".tab"), ".tab", strlen (".tab"))
- || !strncmp (*ext - strlen ("_tab"), "_tab", strlen ("_tab"))))
- *tab = *ext - strlen (".tab");
+ if (*ext)
+ {
+ size_t baselen = *ext - *base;
+ size_t dottablen = 4;
+ if (dottablen < baselen
+ && (strncmp (*ext - dottablen, ".tab", dottablen) == 0
+ || strncmp (*ext - dottablen, "_tab", dottablen) == 0))
+ *tab = *ext - dottablen;
+ }