There are already provisions for it in most places, but the loss occurs in Database::StoreCharacter(), which is called right after starting items are populated.
The charges field in the inventory table is unsigned and the item charges are written without any testing.
Code:
MakeAnyLenString
(
&invquery,
"INSERT INTO inventory SET "
"charid=%0u, slotid=%0d, itemid=%0u, charges=%0d, color=%0u",
charid, i, newinv->GetItem()->ID,
newinv->GetCharges(), newinv->GetColor()
);