summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-01-22 23:01:41 -0500
committerJune McEnroe <june@causal.agency>2022-01-22 23:01:41 -0500
commit9db3c6ad47922c4dc5458448c2fe79734bb4468d (patch)
treee0497de58687faca244c086afe61e482f51cec89
parentFix size of padding counter (diff)
downloadwep-9db3c6ad47922c4dc5458448c2fe79734bb4468d.tar.gz
wep-9db3c6ad47922c4dc5458448c2fe79734bb4468d.zip
Only open the ICO file once we have something to output
-rw-r--r--tools/exe2ico.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/exe2ico.c b/tools/exe2ico.c
index d84d3df..5cf0483 100644
--- a/tools/exe2ico.c
+++ b/tools/exe2ico.c
@@ -49,8 +49,6 @@ int main(int argc, char *argv[]) {
 
 	SDL_RWops *exe = SDL_RWFromFile(exePath, "rb");
 	if (!exe) err(1, "%s", exePath);
-	SDL_RWops *ico = SDL_RWFromFile(icoPath, "wb");
-	if (!ico) err(1, "%s", icoPath);
 
 	// Read the EXE header
 	if (SDL_ReadU8(exe) != 'M' || SDL_ReadU8(exe) != 'Z') {
@@ -85,6 +83,9 @@ int main(int argc, char *argv[]) {
 		SDL_RWseek(exe, 0x0C * count, RW_SEEK_CUR);
 	}
 
+	SDL_RWops *ico = SDL_RWFromFile(icoPath, "wb");
+	if (!ico) err(1, "%s", icoPath);
+
 	// Copy the ICONHEADER
 	// https://devblogs.microsoft.com/oldnewthing/20101018-00/?p=12513
 	SDL_RWseek(exe, (Uint32)SDL_ReadLE16(exe) << alignmentShift, RW_SEEK_SET);
.sh?id=d630ef7d01890a8d32638395ffa163b8cf02424b&follow=1'>Support long double in c.shJune McEnroe 2021-01-13Update Terminal.app coloursJune McEnroe 2021-01-13Increase dark white brightness slightlyJune McEnroe 2021-01-13Add hilex example to htagml manualJune McEnroe 2021-01-12Style causal.agency like bin HTMLJune McEnroe 2021-01-12Avoid matching tag text inside HTML elementsJune McEnroe 2021-01-12Use hilex for up -hJune McEnroe 2021-01-12Use hilex for bin HTMLJune McEnroe 2021-01-12Don't output a pre in hilex by defaultJune McEnroe 2021-01-12Move hilex out of hilex directoryJune McEnroe 2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe 2021-01-12Split fields by tab onlyJune McEnroe 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe