Commit 1518bfef authored by Alessandro Rubini's avatar Alessandro Rubini

userspace: wrs_dump_shm: obey size in strings

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent b70c0d73
......@@ -78,12 +78,14 @@ void dump_one_field(void *addr, struct dump_info *info)
struct TimeInternal *ti = p;
struct PortIdentity *pi = p;
struct ClockQuality *cq = p;
char format[16];
int i;
printf(" %-30s ", info->name); /* name includes trailing ':' */
switch(info->type) {
case dump_type_char:
printf("\"%s\"\n", (char *)p);
sprintf(format,"\"%%.%is\"\n", info->size);
printf(format, (char *)p);
break;
case dump_type_bina:
for (i = 0; i < info->size; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment