=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/finger/sprint.c,v retrieving revision 1.10 retrieving revision 1.11 diff -c -r1.10 -r1.11 *** src/usr.bin/finger/sprint.c 2004/03/15 02:50:29 1.10 --- src/usr.bin/finger/sprint.c 2005/08/23 13:43:53 1.11 *************** *** 1,4 **** ! /* $OpenBSD: sprint.c,v 1.10 2004/03/15 02:50:29 tedu Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: sprint.c,v 1.11 2005/08/23 13:43:53 espie Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. *************** *** 34,40 **** #ifndef lint /*static char sccsid[] = "from: @(#)sprint.c 5.8 (Berkeley) 12/4/90";*/ ! static const char rcsid[] = "$OpenBSD: sprint.c,v 1.10 2004/03/15 02:50:29 tedu Exp $"; #endif /* not lint */ #include --- 34,40 ---- #ifndef lint /*static char sccsid[] = "from: @(#)sprint.c 5.8 (Berkeley) 12/4/90";*/ ! static const char rcsid[] = "$OpenBSD: sprint.c,v 1.11 2005/08/23 13:43:53 espie Exp $"; #endif /* not lint */ #include *************** *** 55,60 **** --- 55,61 ---- int cnt; char *p; PERSON **list; + struct storage *mem; list = sort(); /* *************** *** 84,93 **** for (cnt = 0; cnt < entries; ++cnt) { pn = list[cnt]; for (w = pn->whead; w != NULL; w = w->next) { (void)printf("%-*.*s %-*.*s ", ! NAME_WIDTH, UT_NAMESIZE, vs(pn->name), MAXREALNAME, MAXREALNAME, ! pn->realname ? vs(pn->realname) : ""); if (!w->loginat) { (void)printf(" * * No logins "); goto office; --- 85,95 ---- for (cnt = 0; cnt < entries; ++cnt) { pn = list[cnt]; for (w = pn->whead; w != NULL; w = w->next) { + mem = NULL; (void)printf("%-*.*s %-*.*s ", ! NAME_WIDTH, UT_NAMESIZE, vs(&mem, pn->name), MAXREALNAME, MAXREALNAME, ! pn->realname ? vs(&mem, pn->realname) : ""); if (!w->loginat) { (void)printf(" * * No logins "); goto office; *************** *** 119,133 **** if (oflag) { if (pn->office) (void)printf("%-10.10s", ! vs(pn->office)); else if (pn->officephone) (void)printf("%-10.10s", " "); if (pn->officephone) (void)printf(" %-.15s", ! vs(prphone(pn->officephone))); } else (void)printf("%.*s", MAXHOSTNAME, w->host); putchar('\n'); } } } --- 121,136 ---- if (oflag) { if (pn->office) (void)printf("%-10.10s", ! vs(&mem, pn->office)); else if (pn->officephone) (void)printf("%-10.10s", " "); if (pn->officephone) (void)printf(" %-.15s", ! vs(&mem, prphone(pn->officephone))); } else (void)printf("%.*s", MAXHOSTNAME, w->host); putchar('\n'); + free_storage(mem); } } }