shithub: cstory

Download patch

ref: 6c8a02e604e61cc23998a47302d5584d8c2525bc
parent: 3158273cea9ce729df6858b2f042493260150fed
author: Clownacy <[email protected]>
date: Mon Jan 28 13:38:30 EST 2019

Give bin2h a return value

Fixes #16

--- a/res/bin2h.c
+++ b/res/bin2h.c
@@ -8,6 +8,8 @@
 
 int main(int argc, char *argv[])
 {
+	int result = 0;
+
 	if (argc > 2)
 	{
 		char *last_forward_slash = strrchr(argv[1], '/');
@@ -29,10 +31,12 @@
 		if (in_file == NULL)
 		{
 			printf("Couldn't open '%s'\n", argv[1]);
+			result = 1;
 		}
 		else if (out_file == NULL)
 		{
 			printf("Couldn't open '%s'\n", argv[2]);
+			result = 1;
 		}
 		else
 		{
@@ -64,4 +68,10 @@
 
 		free(filename);
 	}
+	else
+	{
+		result = 1;
+	}
+
+	return result;
 }