Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
411fe29a
Commit
411fe29a
authored
May 27, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fnt2fon: Clean output files when aborting on an error or signal.
parent
3f1bc3a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
fnt2fon.c
tools/fnt2fon.c
+23
-1
No files found.
tools/fnt2fon.c
View file @
411fe29a
...
...
@@ -21,6 +21,7 @@
#include "config.h"
#include "wine/port.h"
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
...
@@ -55,6 +56,18 @@ static const BYTE MZ_hdr[] = {'M', 'Z', 0x0d, 0x01, 0x01, 0x00, 0x00, 0x00, 0x
'm'
,
'o'
,
'd'
,
'e'
,
0x0d
,
0x0a
,
0x24
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
};
static
const
char
*
output_file
;
static
void
cleanup_files
(
void
)
{
if
(
output_file
)
unlink
(
output_file
);
}
static
void
exit_on_signal
(
int
sig
)
{
exit
(
1
);
/* this will call the atexit functions */
}
static
void
usage
(
char
**
argv
)
{
fprintf
(
stderr
,
"%s fntfiles output.fon
\n
"
,
argv
[
0
]);
...
...
@@ -177,7 +190,15 @@ int main(int argc, char **argv)
fontdir_off
=
(
non_resident_name_off
+
non_resident_name_len
+
15
)
&
~
0xf
;
font_off
=
(
fontdir_off
+
fontdir_len
+
15
)
&
~
0x0f
;
ofp
=
fopen
(
argv
[
argc
-
1
],
"wb"
);
atexit
(
cleanup_files
);
signal
(
SIGTERM
,
exit_on_signal
);
signal
(
SIGINT
,
exit_on_signal
);
#ifdef SIGHUP
signal
(
SIGHUP
,
exit_on_signal
);
#endif
output_file
=
argv
[
argc
-
1
];
ofp
=
fopen
(
output_file
,
"wb"
);
fwrite
(
MZ_hdr
,
sizeof
(
MZ_hdr
),
1
,
ofp
);
fwrite
(
&
NE_hdr
,
sizeof
(
NE_hdr
),
1
,
ofp
);
...
...
@@ -288,6 +309,7 @@ int main(int argc, char **argv)
fputc
(
0x00
,
ofp
);
}
fclose
(
ofp
);
output_file
=
NULL
;
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment