/*
* Utility routine.
*
- * Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/* if crypt (a nonstandard crypt) returns a string too large,
truncate it so we don't overrun buffers and hope there is
enough security in what's left */
- if (strlen(cp) > sizeof(cipher)-1) {
- cp[sizeof(cipher)-1] = 0;
- }
- strcpy(cipher, cp);
+ safe_strncpy(cipher, cp, sizeof(cipher));
return cipher;
}