Author: akhaldi
Date: Sun Sep 1 13:23:54 2013
New Revision: 59938
URL:
http://svn.reactos.org/svn/reactos?rev=59938&view=rev
Log:
[RSYM]
* Don't overwrite the MZ header when there are no long section names.
* Correct an error including 4 more bytes than needed in the coff strings.
* Brought to you by Arty.
Modified:
trunk/reactos/tools/rsym/rsym.c
Modified: trunk/reactos/tools/rsym/rsym.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rsym/rsym.c?rev=5993…
==============================================================================
--- trunk/reactos/tools/rsym/rsym.c [iso-8859-1] (original)
+++ trunk/reactos/tools/rsym/rsym.c [iso-8859-1] Sun Sep 1 13:23:54 2013
@@ -1161,13 +1161,18 @@
}
}
- fseek(OutFile, OutFileHeader->PointerToSymbolTable, 0);
- /* COFF string section is preceeded by a length */
- fwrite((char*)&StringTableLength, 1, sizeof(StringTableLength), OutFile);
- /* We just copy enough of the string table to contain the strings we want
- The string table length technically counts as part of the string table
- space itself. */
- fwrite(StringTable+4, 1, StringTableLength, OutFile);
+ if (OutFileHeader->PointerToSymbolTable)
+ {
+ fseek(OutFile, OutFileHeader->PointerToSymbolTable, 0);
+
+ /* COFF string section is preceeded by a length */
+ assert(sizeof(StringTableLength) == 4);
+ fwrite((char*)&StringTableLength, 1, sizeof(StringTableLength), OutFile);
+ /* We just copy enough of the string table to contain the strings we want
+ The string table length technically counts as part of the string table
+ space itself. */
+ fwrite(StringTable + 4, 1, StringTableLength - 4, OutFile);
+ }
if (PaddedRosSym)
{