prof_init.c (profile_get_values): Return PROF_NO_PROFILE if the
authorTheodore Tso <tytso@mit.edu>
Fri, 5 May 1995 04:57:03 +0000 (04:57 +0000)
committerTheodore Tso <tytso@mit.edu>
Fri, 5 May 1995 04:57:03 +0000 (04:57 +0000)
passed-in profile variable is NULL (instead of core dumping).

prof_err.et (PROF_NO_PROFILE): Defined new error code.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5727 dc483132-0cff-0310-8789-dd5450dbe970

src/util/profile/ChangeLog
src/util/profile/prof_err.et
src/util/profile/prof_init.c

index 3bf2b274f8b6b0a7175c93363ac2e9cc6954d50c..086c07a26f1b8af6496f3372c87bd2a46341dc66 100644 (file)
@@ -1,3 +1,10 @@
+Fri May  5 00:02:41 1995  Theodore Y. Ts'o  (tytso@dcl)
+
+       * prof_init.c (profile_get_values): Return PROF_NO_PROFILE if the
+               passed-in profile variable is NULL (instead of core dumping).
+       
+       * prof_err.et (PROF_NO_PROFILE): Defined new error code.
+
 Thu May  4 23:57:56 1995  Theodore Y. Ts'o  (tytso@dcl)
 
        * prof_tree.c (profile_free_node): Copy child->next to a scratch
index 8686829e6b1aea4fc969d51a16678d2d43ba65c0..311570a7f9f8199092e49df869098e618c73341a 100644 (file)
@@ -37,5 +37,6 @@ error_code    PROF_TOPSECTION_ITER_NOSUPP,
 error_code     PROF_INVALID_SECTION,   "Invalid profile_section object"
 error_code     PROF_END_OF_SECTIONS,   "No more sections"
 error_code     PROF_BAD_NAMESET,       "Bad nameset passed to query routine"
+error_code     PROF_NO_PROFILE,        "No profile file open"
 
 end
index 57af950fb3ada3d9f34d363dd7ba604c386b3c33..5dcc84e5350bafd85d7a2e7b899e77b3430e72b9 100644 (file)
@@ -126,6 +126,9 @@ errcode_t profile_get_values(profile, names, ret_values)
     struct string_list values;
     const char         **cpp;
 
+    if (profile == 0)
+       return PROF_NO_PROFILE;
+
     if (names == 0 || names[0] == 0 || names[1] == 0)
        return PROF_BAD_NAMESET;