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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
Description: Handling of some errors
---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:
Origin: vendor
Forwarded: no
Last-Update: 2019-07-25
--- genromfs-0.5.2.orig/Makefile
+++ genromfs-0.5.2/Makefile
@@ -6,8 +6,9 @@ all: genromfs
PACKAGE = genromfs
VERSION = 0.5.2
CC = gcc
-CFLAGS = -O2 -Wall -DVERSION=\"$(VERSION)\"#-g#
-LDFLAGS = -s#-g
+CPPFLAGS = -DVERSION=\"$(VERSION)\"
+CFLAGS = -O2 -Wall -g
+#LDFLAGS = -s#-g
DISTDIR = $(PACKAGE)-$(VERSION)
@@ -24,7 +25,7 @@ genromfs: genromfs.o
$(CC) $(LDFLAGS) genromfs.o -o genromfs
.c.o:
- $(CC) $(CFLAGS) $< -c -o $@
+ $(CC) $(CPPFLAGS) $(CFLAGS) $< -c -o $@
clean:
rm -f genromfs *.o
--- genromfs-0.5.2.orig/genromfs.c
+++ genromfs-0.5.2/genromfs.c
@@ -75,6 +75,7 @@
#include <sys/sysmacros.h>
#endif
+char *outf = NULL;
struct romfh {
int32_t nextfh;
@@ -254,10 +255,16 @@ void dumpdata(void *addr, int len, FILE
if (atoffs==512) {
ri = (struct romfh *)&fixbuf;
fixsum(ri, atoffs<ntohl(ri->size)?atoffs:ntohl(ri->size));
- fwrite(fixbuf, atoffs, 1, f);
+ if (fwrite(fixbuf, atoffs, 1, f) != 1) {
+ perror(outf);
+ exit(1);
+ }
}
if (len) {
- fwrite(addr, len, 1, f);
+ if (fwrite(addr, len, 1, f) != 1) {
+ perror(outf);
+ exit(1);
+ }
atoffs+=len;
}
}
@@ -702,7 +709,6 @@ int main(int argc, char *argv[])
{
int c;
char *dir = ".";
- char *outf = NULL;
char *volname = NULL;
int verbose=0;
char buf[256];
|