- int val;
- val = confnode_get_value(n, NULL, 0);
- printf("[%4d] %s: %s\n", val, n->name, n->prompt);
+#define INTBUFLEN 10
+ char buf[INTBUFLEN];
+
+ memset(buf, 0, sizeof(buf));
+
+ buf[0] = '[';
+ confnode_get_value(n, buf, 0);
+ confnode_get_value(n, &buf[1], INTBUFLEN-1);
+ if (strlen(buf) == INTBUFLEN-1) { /* buffer full */
+ buf[INTBUFLEN-4] = '.';
+ buf[INTBUFLEN-3] = '.';
+ buf[INTBUFLEN-2] = '\0';
+ }
+ strcat(buf, "]");
+
+ while (strlen(buf) < sizeof(buf) - 1)
+ strcat(buf, " ");
+
+ printf("%s %s: %s\n", buf, n->name, n->prompt);