+int DispenseUpdateItem(int User, tItem *Item, const char *NewName, int NewPrice)
+{
+ char *username;
+
+ // Sanity checks
+ if( NewPrice < 0 ) return 2;
+ if( !Item ) return 2;
+ if( strlen(NewName) < 1 ) return 2;
+
+ // Update the item
+ free(Item->Name);
+ Item->Name = strdup(NewName);
+ Item->Price = NewPrice;
+
+ username = Bank_GetAcctName(User);
+
+ Log_Info("item %s:%i updated to '%s' %i by %s",
+ Item->Handler->Name, Item->ID,
+ NewName, NewPrice, username
+ );
+
+ free(username);
+
+ // Update item file
+ Items_UpdateFile();
+
+ return 0;
+}
+