svn rev #25101: trunk/src/include/

ghudson@MIT.EDU ghudson at MIT.EDU
Mon Aug 15 16:29:08 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=25101
Commit By: ghudson
Log Message:
Make data_eq_string work with const strings.


Changed Files:
U   trunk/src/include/k5-int.h
Modified: trunk/src/include/k5-int.h
===================================================================
--- trunk/src/include/k5-int.h	2011-08-13 02:39:24 UTC (rev 25100)
+++ trunk/src/include/k5-int.h	2011-08-15 20:29:07 UTC (rev 25101)
@@ -2720,10 +2720,15 @@
 static inline int
 data_eq(krb5_data d1, krb5_data d2)
 {
-    return (d1.length == d2.length
-            && !memcmp(d1.data, d2.data, d1.length));
+    return (d1.length == d2.length && !memcmp(d1.data, d2.data, d1.length));
 }
 
+static inline int
+data_eq_string (krb5_data d, const char *s)
+{
+    return (d.length == strlen(s) && !memcmp(d.data, s, d.length));
+}
+
 static inline krb5_data
 make_data(void *data, unsigned int len)
 {
@@ -2762,12 +2767,6 @@
 }
 
 static inline int
-data_eq_string (krb5_data d, char *s)
-{
-    return data_eq(d, string2data(s));
-}
-
-static inline int
 authdata_eq(krb5_authdata a1, krb5_authdata a2)
 {
     return (a1.ad_type == a2.ad_type




More information about the cvs-krb5 mailing list