From: John Kohl Date: Thu, 17 May 1990 11:54:49 +0000 (+0000) Subject: change to * made sizeof() break. fixed X-Git-Tag: krb5-1.0-alpha2~538 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dcfb1ce728a61cfd8d0de8bab8bb5519483b20d8;p=krb5.git change to * made sizeof() break. fixed git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@867 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/ktdefname.c b/src/lib/krb5/os/ktdefname.c index b0ae656c7..167167e35 100644 --- a/src/lib/krb5/os/ktdefname.c +++ b/src/lib/krb5/os/ktdefname.c @@ -23,10 +23,6 @@ static char rcsid_ktdefname_c[] = #include #include -#ifndef min -#define min(a,b) ((a) < (b) ? (a) : (b)) -#endif - extern char *krb5_defkeyname; krb5_error_code @@ -34,8 +30,8 @@ krb5_kt_default_name(name, namesize) char *name; int namesize; { - strncpy(name, krb5_defkeyname, min(namesize, sizeof(krb5_defkeyname))); - if (namesize < sizeof(krb5_defkeyname)) + strncpy(name, krb5_defkeyname, namesize); + if (namesize < strlen(krb5_defkeyname)) return KRB5_CONFIG_NOTENUFSPACE; else return 0;