===================================================================
@@ -1117,7 +1117,7 @@ parse_format_list (st_parameter_dt *dtp, bool *see
void
format_error (st_parameter_dt *dtp, const fnode *f, const char *message)
{
- int width, i, j, offset;
+ int width, i, offset;
#define BUFLEN 300
char *p, buffer[BUFLEN];
format_data *fmt = dtp->u.p.fmt;
@@ -1130,13 +1130,10 @@ format_error (st_parameter_dt *dtp, const fnode *f
else
snprintf (buffer, BUFLEN, "%s\n", message);
- j = fmt->format_string - dtp->format;
+ offset = dtp->format_len - fmt->format_string_len;
- offset = (j > 60) ? j - 40 : 0;
+ width = dtp->format_len;
- j -= offset;
- width = dtp->format_len - offset;
-
if (width > 80)
width = 80;
@@ -1144,14 +1141,14 @@ format_error (st_parameter_dt *dtp, const fnode *f
p = strchr (buffer, '\0');
- memcpy (p, dtp->format + offset, width);
+ memcpy (p, dtp->format, width);
p += width;
*p++ = '\n';
/* Show where the problem is */
- for (i = 1; i < j; i++)
+ for (i = 1; i < offset; i++)
*p++ = ' ';
*p++ = '^';