change to * made sizeof() break. fixed
authorJohn Kohl <jtkohl@mit.edu>
Thu, 17 May 1990 11:54:49 +0000 (11:54 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Thu, 17 May 1990 11:54:49 +0000 (11:54 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@867 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/ktdefname.c

index b0ae656c7f7869414a77392b8fffb4d4b941e915..167167e359e6d91a3ecfd0d1f7e1b3d747341766 100644 (file)
@@ -23,10 +23,6 @@ static char rcsid_ktdefname_c[] =
 #include <stdio.h>
 #include <krb5/ext-proto.h>
 
-#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;