=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/util.c,v retrieving revision 1.63 retrieving revision 1.64 diff -c -r1.63 -r1.64 *** src/usr.bin/cvs/util.c 2005/12/24 19:07:52 1.63 --- src/usr.bin/cvs/util.c 2005/12/30 16:47:36 1.64 *************** *** 1,4 **** ! /* $OpenBSD: util.c,v 1.63 2005/12/24 19:07:52 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: util.c,v 1.64 2005/12/30 16:47:36 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 124,142 **** * The CVS protocol specification states that any modes or mode types that are * not recognized should be silently ignored. This function does not return * an error in such cases, but will issue warnings. - * Returns 0 on success, or -1 on failure. */ ! int cvs_strtomode(const char *str, mode_t *mode) { char type; mode_t m; char buf[32], ms[4], *sp, *ep; m = 0; ! if (strlcpy(buf, str, sizeof(buf)) >= sizeof(buf)) { ! return (-1); ! } sp = buf; ep = sp; --- 124,143 ---- * The CVS protocol specification states that any modes or mode types that are * not recognized should be silently ignored. This function does not return * an error in such cases, but will issue warnings. */ ! void cvs_strtomode(const char *str, mode_t *mode) { char type; + size_t l; mode_t m; char buf[32], ms[4], *sp, *ep; m = 0; ! l = strlcpy(buf, str, sizeof(buf)); ! if (l >= sizeof(buf)) ! fatal("cvs_strtomode: string truncation"); ! sp = buf; ep = sp; *************** *** 174,181 **** } *mode = m; - - return (0); } --- 175,180 ----