Skip to content

Commit

Permalink
Going back to strcpy instead of memset
Browse files Browse the repository at this point in the history
  • Loading branch information
AbelPau committed Apr 17, 2024
1 parent e88acdc commit e11c902
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions ogr/ogrsf_frmts/miramon/mm_gdal_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,6 @@ int MM_SprintfDoubleSignifFigures(char *szChain, size_t size_szChain,
return 0;
exponent = atoi(ptr + 1);

dfRealValue = CPLAtof(szChain);
return sprintf(szChain, "%.*f",
(nSignifFigures - exponent - 1) > 0
? (nSignifFigures - exponent - 1)
Expand Down Expand Up @@ -2408,9 +2407,7 @@ int MM_SecureCopyStringFieldValue(char **pszStringDst, const char *pszStringSrc,
*nStringCurrentLength = (MM_EXT_DBF_N_FIELDS)(strlen(pszStringSrc) + 1);
}

// We just copy the exact number of elements we want to copy.
// If we copy more than them, some garbage can appear in the record
memcpy(*pszStringDst, pszStringSrc, strlen(pszStringSrc));
strcpy(*pszStringDst, pszStringSrc);
return 0;
}

Expand Down

0 comments on commit e11c902

Please sign in to comment.