Skip to content

Commit

Permalink
Write NULL Date independently of width
Browse files Browse the repository at this point in the history
  • Loading branch information
thbeu committed Jul 15, 2024
1 parent fb50db8 commit 3b6b0c9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions dbfopen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,9 +1311,18 @@ static bool DBFWriteAttribute(DBFHandle psDBF, int hEntity, int iField,
/* -------------------------------------------------------------------- */
if (pValue == SHPLIB_NULLPTR)
{
memset(pabyRec + psDBF->panFieldOffset[iField],
DBFGetNullCharacter(psDBF->pachFieldType[iField]),
psDBF->panFieldSize[iField]);
if (psDBF->pachFieldType[iField] == 'D')
{
// NULL Date is independent of panFieldSize
pabyRec += psDBF->panFieldOffset[iField];
pabyRec = SHPLIB_NULLPTR;
}
else
{
memset(pabyRec + psDBF->panFieldOffset[iField],
DBFGetNullCharacter(psDBF->pachFieldType[iField]),
psDBF->panFieldSize[iField]);
}
return true;
}

Expand Down

0 comments on commit 3b6b0c9

Please sign in to comment.