=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rdist/common.c,v retrieving revision 1.16 retrieving revision 1.17 diff -c -r1.16 -r1.17 *** src/usr.bin/rdist/common.c 2002/06/23 03:07:22 1.16 --- src/usr.bin/rdist/common.c 2003/04/05 20:31:58 1.17 *************** *** 1,4 **** ! /* $OpenBSD: common.c,v 1.16 2002/06/23 03:07:22 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: common.c,v 1.17 2003/04/05 20:31:58 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. *************** *** 39,45 **** "$From: common.c,v 6.82 1998/03/23 23:27:33 michaelc Exp $"; #else static char RCSid[] = ! "$OpenBSD: common.c,v 1.16 2002/06/23 03:07:22 deraadt Exp $"; #endif static char sccsid[] = "@(#)common.c"; --- 39,45 ---- "$From: common.c,v 6.82 1998/03/23 23:27:33 michaelc Exp $"; #else static char RCSid[] = ! "$OpenBSD: common.c,v 1.17 2003/04/05 20:31:58 deraadt Exp $"; #endif static char sccsid[] = "@(#)common.c"; *************** *** 481,487 **** if (debug) { static char mbuf[BUFSIZ]; ! (void) sprintf(mbuf, "<<< Cmd = %c (\\%3.3o) Msg = \"%s\"", buffer[0], buffer[0], buffer + 1); --- 481,487 ---- if (debug) { static char mbuf[BUFSIZ]; ! (void) snprintf(mbuf, sizeof mbuf, "<<< Cmd = %c (\\%3.3o) Msg = \"%s\"", buffer[0], buffer[0], buffer + 1); *************** *** 552,558 **** * do the opts check. */ if (IS_ON(opts, DO_NUMCHKOWNER)) { ! (void) sprintf(buf, ":%u", uid); return(buf); } --- 552,558 ---- * do the opts check. */ if (IS_ON(opts, DO_NUMCHKOWNER)) { ! (void) snprintf(buf, sizeof buf, ":%u", uid); return(buf); } *************** *** 567,575 **** if ((pwd = getpwuid(uid)) == NULL) { message(MT_WARNING, "%s: No password entry for uid %u", file, uid); ! (void) sprintf(buf, ":%u", uid); } else ! (void) strcpy(buf, pwd->pw_name); return(buf); } --- 567,575 ---- if ((pwd = getpwuid(uid)) == NULL) { message(MT_WARNING, "%s: No password entry for uid %u", file, uid); ! (void) snprintf(buf, sizeof buf, ":%u", uid); } else ! (void) strlcpy(buf, pwd->pw_name, sizeof buf); return(buf); } *************** *** 591,597 **** * do the opts check. */ if (IS_ON(opts, DO_NUMCHKGROUP)) { ! (void) sprintf(buf, ":%u", gid); return(buf); } --- 591,597 ---- * do the opts check. */ if (IS_ON(opts, DO_NUMCHKGROUP)) { ! (void) snprintf(buf, sizeof buf, ":%u", gid); return(buf); } *************** *** 605,613 **** if ((grp = (struct group *)getgrgid(gid)) == NULL) { message(MT_WARNING, "%s: No name for group %u", file, gid); ! (void) sprintf(buf, ":%u", gid); } else ! (void) strcpy(buf, grp->gr_name); return(buf); } --- 605,613 ---- if ((grp = (struct group *)getgrgid(gid)) == NULL) { message(MT_WARNING, "%s: No name for group %u", file, gid); ! (void) snprintf(buf, sizeof buf, ":%u", gid); } else ! (void) strlcpy(buf, grp->gr_name, sizeof buf); return(buf); } *************** *** 805,811 **** { static char buff[BUFSIZ]; ! (void) sprintf(buff, "Version %s.%d (%s) - Protocol Version %d, Release %s, Patch level %d", DISTVERSION, PATCHLEVEL, DISTSTATUS, VERSION, DISTVERSION, PATCHLEVEL); --- 805,811 ---- { static char buff[BUFSIZ]; ! (void) snprintf(buff, sizeof buff, "Version %s.%d (%s) - Protocol Version %d, Release %s, Patch level %d", DISTVERSION, PATCHLEVEL, DISTSTATUS, VERSION, DISTVERSION, PATCHLEVEL);