summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2015-05-11 21:32:31 -0500
committerBobby Bingham <koorogi@koorogi.info>2015-09-15 22:43:32 -0500
commit882c09f53c0966336537450f0d771c8d30518343 (patch)
tree5f8dd5a266a2458601341c203cfcdcad31685a8b /src
parentb22e3a405df560f0c8828c5448aafdf05332e86e (diff)
fix incorrect accounting of region codes in output size
Diffstat (limited to 'src')
-rw-r--r--src/satmkboot.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/satmkboot.c b/src/satmkboot.c
index 6abae51..a3e4d7e 100644
--- a/src/satmkboot.c
+++ b/src/satmkboot.c
@@ -26,17 +26,16 @@ static struct systemid sysid = {
static char ipbuf[0x7200];
static char *ipfile, *outfile;
-static char *serialize_region_code(char *out, const struct symbolname *region)
+static void serialize_region_code(char *out, const struct symbolname *region)
{
size_t namelen = strlen(region->name);
char *tmp = out;
char *end = out+32;
- memcpy(tmp, "\xa0\x0e\x00\x09For ", 8); tmp += 8;
- memcpy(tmp, region->name, namelen); tmp += namelen;
+ memcpy(tmp, "\xa0\x0e\x00\x09" "For ", 8); tmp += 8;
+ memcpy(tmp, region->name, namelen); tmp += namelen;
*tmp++ = '.';
memset(tmp, ' ', end - tmp);
- return end;
}
#define WRITE(f,p,s) fwrite(p,s,1,f)
@@ -307,7 +306,11 @@ int main(int argc, char **argv)
for (int i = 0; i < 10 && sysid.regions[i] != ' '; i++) {
const struct symbolname *region = find_symbol(regiondefs, sysid.regions[i]);
- if (region) ipout = serialize_region_code(ipout, region);
+ if (region) {
+ serialize_region_code(ipout, region);
+ ipout += 32;
+ sysid.bootsize += 32;
+ }
}
ipsize = ipfile