Commit ee80489d authored by Luis Kornblueh's avatar Luis Kornblueh
Browse files

Changed strncpy to memcpy for uuid to prevent accidently shortend uuids.

parent 7281514e
......@@ -4212,7 +4212,7 @@ char *gridInqUUID(int gridID, char *uuid)
grid_check_ptr(gridID, gridptr);
strncpy(uuid, gridptr->uuid, 16);
memcpy(uuid, gridptr->uuid, 16);
return (uuid);
}
......@@ -4232,7 +4232,7 @@ void gridDefUUID(int gridID, const char *uuid)
grid_check_ptr(gridID, gridptr);
strncpy(gridptr->uuid, uuid, 16);
memcpy(gridptr->uuid, uuid, 16);
return;
}
......
......@@ -605,7 +605,7 @@ void gribapiGetGrid(grib_handle *gh, grid_t *grid)
len = (size_t) 16;
if ( grib_get_bytes(gh, "uuidOfHGrid", (unsigned char *) uuid, &len) == 0)
{
strncpy(grid->uuid, uuid, 16);
memcpy(grid->uuid, uuid, 16);
}
}
break;
......
......@@ -654,7 +654,7 @@ void varDefZAxisReference(int nlev, int nvgrid, char *uuid)
{
numberOfVerticalLevels = nlev;
numberOfVerticalGrid = nvgrid;
strncpy(uuidVGrid, uuid, 16);
memcpy(uuidVGrid, uuid, 16);
}
......
......@@ -717,7 +717,7 @@ void zaxisDefUUID(int zaxisID, const char *uuid)
zaxis_check_ptr(zaxisID, zaxisptr);
strncpy(zaxisptr->uuid, uuid, 16);
memcpy(zaxisptr->uuid, uuid, 16);
return;
}
......@@ -745,7 +745,7 @@ char *zaxisInqUUID(int zaxisID, char *uuid)
zaxis_check_ptr(zaxisID, zaxisptr);
strncpy(uuid, zaxisptr->uuid, 16);
memcpy(uuid, zaxisptr->uuid, 16);
return (uuid);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment