=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rdist/message.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/usr.bin/rdist/message.c 2003/06/03 02:56:14 1.15 +++ src/usr.bin/rdist/message.c 2007/09/11 15:47:17 1.16 @@ -1,4 +1,4 @@ -/* $OpenBSD: message.c,v 1.15 2003/06/03 02:56:14 millert Exp $ */ +/* $OpenBSD: message.c,v 1.16 2007/09/11 15:47:17 gilles Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -37,7 +37,7 @@ "$From: message.c,v 1.5 1999/11/01 00:21:39 christos Exp $"; #else static char RCSid[] __attribute__((__unused__)) = -"$OpenBSD: message.c,v 1.15 2003/06/03 02:56:14 millert Exp $"; +"$OpenBSD: message.c,v 1.16 2007/09/11 15:47:17 gilles Exp $"; #endif static char sccsid[] __attribute__((__unused__)) = @@ -517,8 +517,7 @@ /* * Ensure no stray newlines are present */ - if ((cp = strchr(msgbuf, '\n')) != NULL) - *cp = CNULL; + msgbuf[strcspn(msgbuf, "\n")] = CNULL; checkhostname(); if (strncmp(currenthost, msgbuf, strlen(currenthost)) == 0)