Skip to content

Commit

Permalink
fix -Werror=stringop-truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
MadVitaliy authored and malaterre committed Jan 7, 2025
1 parent 5ea66b2 commit b0a3664
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/DataStructureAndEncodingDefinition/gdcmElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ static void x16printf(char *buf, int size, Float f) {
strcpy(buf, mant);
return;
}
strncpy(buf, mant, iexp + 1);
memcpy(buf, mant, iexp + 1);
buf[iexp + 1] = '.';
strncpy(buf + iexp + 2, mant + iexp + 1, size - iexp - 1);
buf[size] = 0;
Expand All @@ -409,7 +409,7 @@ static void x16printf(char *buf, int size, Float f) {
for(j=0; j< -1 - iexp; j++) {
buf[j+1] = '0';
}
strncpy(buf - iexp, mant, size + 1 + iexp);
memcpy(buf - iexp, mant, size + 1 + iexp);
buf[size] = 0;
clean(buf);
}
Expand Down

0 comments on commit b0a3664

Please sign in to comment.