Skip to content

Commit

Permalink
Per #2809, call m_strncpy() to set LaeaData::spheroid_name
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Feb 6, 2024
1 parent e35b42b commit d61e342
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libcode/vx_data2d_nc_met/get_met_grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ LambertData get_lambert_data(NcFile * ncfile) {

LaeaData get_laea_data(NcFile * ncfile) {

const char * method_name = "get_laea_data() -> ";

LaeaData data;
ConcatString att_value;

Expand All @@ -329,7 +331,7 @@ LaeaData get_laea_data(NcFile * ncfile) {

// Spheroid name
get_global_att(ncfile, string("spheroid_name"), att_value);
data.spheroid_name = att_value;
m_strncpy(data.spheroid_name, att_value.c_str(), att_value.length(), method_name);

// Grid spacing in km
get_global_att(ncfile, string("radius_km"), data.radius_km);
Expand Down

0 comments on commit d61e342

Please sign in to comment.