diff --git a/slist.c b/slist.c index 61b0b97..b3072c7 100644 --- a/slist.c +++ b/slist.c @@ -41,6 +41,10 @@ static unsigned long node_to_number(uint8 *addr) static void print_net_node_status(uint8 *addr, int is_default) { + /* + * Novell SLIST prints the node address as a right-aligned decimal + * number in a 12 character bracketed field. + */ fprintf(stdout, "[%08lX][%12lu]%s", (unsigned long)GET_BE32(addr), node_to_number(addr), @@ -77,14 +81,14 @@ int func_slist(int argc, char *argv[], int mode) upstr(pattern); /* - * Match Novell SLIST layout: - * "Known NetWare File Servers" at column 1, - * "Network" at column 45, "Node Address" at column 54. + * These two format strings are copied from the official Novell SLIST.EXE + * string table: + * + * "Known NetWare File Servers Network Node Address Status\n" + * "-------------------------- ------- ------------ ------\n" */ - fprintf(stdout, "%-44sNetwork Node Address Status\n", - "Known NetWare File Servers"); - fprintf(stdout, "%-44s-------- -------------------\n", - "-------------------------"); + fprintf(stdout, "Known NetWare File Servers Network Node Address Status\n"); + fprintf(stdout, "-------------------------- ------- ------------ ------\n"); while ((result = ncp_17_37(last_id, NCP_BINDERY_FSERVER, pattern, &obj)) == 0) { @@ -93,7 +97,11 @@ int func_slist(int argc, char *argv[], int mode) found++; last_id = obj.object_id; - fprintf(stdout, "%-44s", obj.object_name); + /* + * The official header puts the Network column at column 53, so the + * server name field is 52 characters wide. + */ + fprintf(stdout, "%-52s", obj.object_name); if (!ncp_17_3d(NCP_BINDERY_FSERVER, obj.object_name, 1, "NET_ADDRESS", &prop)) {