projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] dnsmasq: Fix setting the network-id for config host sections
[openwrt.git]
/
tools
/
firmware-utils
/
src
/
trx.c
diff --git
a/tools/firmware-utils/src/trx.c
b/tools/firmware-utils/src/trx.c
index
787ffa8
..
b983023
100644
(file)
--- a/
tools/firmware-utils/src/trx.c
+++ b/
tools/firmware-utils/src/trx.c
@@
-60,7
+60,7
@@
uint32_t crc32buf(char *buf, size_t len);
#define TRX_MAGIC 0x30524448 /* "HDR0" */
#define TRX_VERSION 1
#define TRX_MAGIC 0x30524448 /* "HDR0" */
#define TRX_VERSION 1
-#define TRX_MAX_LEN 0x
5A
0000
+#define TRX_MAX_LEN 0x
72
0000
#define TRX_NO_HEADER 1 /* Do not write TRX header */
struct trx_header {
#define TRX_NO_HEADER 1 /* Do not write TRX header */
struct trx_header {
@@
-88,7
+88,7
@@
int main(int argc, char **argv)
char *ofn = NULL;
char *buf;
char *e;
char *ofn = NULL;
char *buf;
char *e;
- int c, i;
+ int c, i
, append = 0
;
size_t n;
uint32_t cur_len;
unsigned long maxlen = TRX_MAX_LEN;
size_t n;
uint32_t cur_len;
unsigned long maxlen = TRX_MAX_LEN;
@@
-110,11
+110,15
@@
int main(int argc, char **argv)
in = NULL;
i = 0;
in = NULL;
i = 0;
- while ((c = getopt(argc, argv, "-:o:m:a:b:f:")) != -1) {
+ while ((c = getopt(argc, argv, "-:o:m:a:b:f:
A:
")) != -1) {
switch (c) {
switch (c) {
+ case 'A':
+ append = 1;
+ /* fall through */
case 'f':
case 1:
case 'f':
case 1:
- p->offsets[i++] = STORE32_LE(cur_len);
+ if (!append)
+ p->offsets[i++] = STORE32_LE(cur_len);
if (!(in = fopen(optarg, "r"))) {
fprintf(stderr, "can not open \"%s\" for reading\n", optarg);
if (!(in = fopen(optarg, "r"))) {
fprintf(stderr, "can not open \"%s\" for reading\n", optarg);
@@
-134,6
+138,7
@@
int main(int argc, char **argv)
n += ROUND - (n & (ROUND-1));
}
cur_len += n;
n += ROUND - (n & (ROUND-1));
}
cur_len += n;
+ append = 0;
break;
case 'o':
break;
case 'o':
@@
-167,6
+172,7
@@
int main(int argc, char **argv)
fprintf(stderr, "realloc failed");
return EXIT_FAILURE;
}
fprintf(stderr, "realloc failed");
return EXIT_FAILURE;
}
+ p = (struct trx_header *) buf;
break;
case 'a':
errno = 0;
break;
case 'a':
errno = 0;
@@
-225,7
+231,7
@@
int main(int argc, char **argv)
}
fclose(out);
}
fclose(out);
-
+
return EXIT_SUCCESS;
}
return EXIT_SUCCESS;
}
This page took
0.023274 seconds
and
4
git commands to generate.