summaryrefslogtreecommitdiff
path: root/package/ympd/patches/patch-htdocs_mkdata_c
blob: e285e5dc3fd4017b9fdf3ee32f46975be9527c86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- ympd-1.2.2.orig/htdocs/mkdata.c	2014-09-28 13:39:27.000000000 +0200
+++ ympd-1.2.2/htdocs/mkdata.c	2014-10-05 08:52:52.000000000 +0200
@@ -7,7 +7,6 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <error.h>
 #include <errno.h>
 #include <string.h>
 
@@ -58,16 +57,20 @@ int main(int argc, char *argv[])
     int i, j, buf;
     FILE *fd;
 
-    if(argc <= 1)
-        error(EXIT_FAILURE, 0, "Usage: ./%s <this_file> <file1> [file2, ...] > embedded_data.c", argv[0]);
+    if(argc <= 1) {
+        printf("Usage: ./%s <this_file> <file1> [file2, ...] > embedded_data.c", argv[0]);
+	exit(EXIT_FAILURE);
+    }
 
     for(i = 1; i < argc; i++)
     {
         printf("static const unsigned char v%d[] = {", i);
         
         fd = fopen(argv[i], "r");
-        if(!fd)
-            error(EXIT_FAILURE, errno, "Failed open file %s", argv[i]);
+        if(!fd) {
+            printf("Failed open file %s", argv[i]);
+	    exit(EXIT_FAILURE);
+	}
 
         j = 0;
         while((buf = fgetc(fd)) != EOF)