summary refs log tree commit diff
diff options
context:
space:
mode:
-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);
title='2019-01-12 14:43:31 -0500'>2019-01-12Install gnupg2 from pkgsrc and symlink gpgJune McEnroe 2019-01-12Reference cash builtin man pages in cash.1 SEE ALSOJune McEnroe 2019-01-12Restore cash builtin man page datesJune McEnroe 2019-01-12Use local libeditJune McEnroe 2019-01-12Replace libedit MakefileJune McEnroe 2019-01-11Import /usr/src/lib/libedit from NetBSD 8.0June McEnroe 2019-01-11Add PSlit for prompt escapesJune McEnroe 2019-01-11Don't make depend automaticallyJune McEnroe