--- a/exodus/cbind/src/ex_get_name.c
+++ b/exodus/cbind/src/ex_get_name.c
@@ -125,7 +125,8 @@
     /* read the name */
     {
       int db_name_size = ex_inquire_int(exoid, EX_INQ_DB_MAX_ALLOWED_NAME_LENGTH);
-      int name_size = db_name_size < ex_max_name_length ? db_name_size : ex_max_name_length;
+      int api_name_size = ex_inquire_int(exoid, EX_INQ_MAX_READ_NAME_LENGTH);
+      int name_size = db_name_size < api_name_size ? db_name_size : api_name_size;
 
       status = ex_get_name_internal(exoid, varid, ent_ndx-1, name, name_size, obj_type, routine);
       if (status != NC_NOERR) {