static void
xdflds(struct castr ca[], void *ptr)
{
- int i, j;
+ int i, j, n;
struct valstr val;
char *sep = "";
continue;
if (ca[i].ca_flags & NSC_EXTRA)
continue;
+ n = ca[i].ca_type != NSC_STRINGY ? ca[i].ca_len : 0;
j = 0;
do {
xdeval(&val, ca[i].ca_type, ptr, ca[i].ca_off, j);
sep = xdprval(&val, sep);
- } while (++j < ca[i].ca_len);
+ } while (++j < n);
}
}
if (ca[i].ca_flags & NSC_EXTRA)
continue;
pr("%s%s", sep, ca[i].ca_name);
- if (ca[i].ca_len)
+ if (ca[i].ca_len && ca[i].ca_type != NSC_STRINGY)
pr(" %d", ca[i].ca_len);
sep = " ";
}
{NSC_TIME, 0, 0, fldoff(shpstr, shp_access), "access"},
{NSC_TIME, 0, 0, fldoff(shpstr, shp_timestamp), "timestamp"},
/* FIXME sail stuff missing */
- {NSC_STRINGY, 0, 0, fldoff(shpstr, shp_name), "name"},
+ {NSC_STRINGY, 0, MAXSHPNAMLEN, fldoff(shpstr, shp_name), "name"},
{NSC_UCHAR, 0, 0, fldoff(shpstr, shp_fuel), "fuel"},
{NSC_UCHAR, 0, 0, fldoff(shpstr, shp_nchoppers), "nchoppers"},
{NSC_UCHAR, 0, 0, fldoff(shpstr, shp_nxlight), "nxlight"},