MCPcopy Create free account
hub / github.com/Meridian59/Meridian59 / FileBackpatch

Function FileBackpatch

roomedit/source/save.cpp:1028–1036  ·  view source on GitHub ↗

/ * FileBackpatch: Write "data" to the 4 bytes starting at position "pos" in the file. * This function leaves the file pointer at the same place as when the function was called. */

Source from the content-addressed store, hash-verified

1026 * This function leaves the file pointer at the same place as when the function was called.
1027 */
1028void FileBackpatch(FILE *file, int pos, int data)
1029{
1030 int cur_pos;
1031
1032 cur_pos = FileCurPos(file);
1033 FileGoto(file, pos);
1034 WriteBytes(file, &data, 4);
1035 FileGoto(file, cur_pos);
1036}
1037/***************************************************************************/
1038/*
1039 * BackupFile: Copy fname to a backup name if it already exists.

Callers 1

SaveLevelDataFunction · 0.85

Calls 1

WriteBytesFunction · 0.85

Tested by

no test coverage detected