Commit 68412c35 authored by Florian Schulze's avatar Florian Schulze

Fixed pack and unpack.

parent 3e432268
jumpnbump.ncb jumpnbump.plg jumpnbump.opt
Debug Release
jnb.tmpmusic.mod stdout.txt stderr.txt
jumpbump.dat
cd %1 cd %1
%2 -o jumpbump.dat bump.mod calib.dat death.smp fly.smp font.gob jump.mod jump.smp level.pcx levelmap.txt mask.pcx menu.pcx menumask.pcx numbers.gob objects.gob rabbit.gob scores.mod splash.smp spring.smp %2 -o jumpbump.dat bump.mod calib.dat death.smp fly.smp font.gob jump.mod jump.smp levelmap.txt level.pcx mask.pcx menu.pcx menumask.pcx numbers.gob objects.gob rabbit.gob scores.mod splash.smp spring.smp
...@@ -94,7 +94,7 @@ int main(int argc, char **argv) ...@@ -94,7 +94,7 @@ int main(int argc, char **argv)
} }
/* here, we checked that all files are ok, and ready to roll the packfile */ /* here, we checked that all files are ok, and ready to roll the packfile */
fd = open(outfile, O_RDWR | O_CREAT, 0644); fd = open(outfile, O_RDWR | O_CREAT | O_BINARY, 0644);
if (fd == -1) { if (fd == -1) {
perror("opening packfile"); perror("opening packfile");
exit(1); exit(1);
...@@ -116,7 +116,7 @@ int main(int argc, char **argv) ...@@ -116,7 +116,7 @@ int main(int argc, char **argv)
printf("adding %s ", argv[i]); printf("adding %s ", argv[i]);
infd = open(argv[i], O_RDONLY); infd = open(argv[i], O_RDONLY | O_BINARY);
if (infd == -1) { if (infd == -1) {
perror("opening file"); perror("opening file");
exit(1); exit(1);
......
...@@ -27,7 +27,7 @@ int main(int argc, char **argv) ...@@ -27,7 +27,7 @@ int main(int argc, char **argv)
exit(1); exit(1);
} }
fd = open(argv[1], O_RDONLY); fd = open(argv[1], O_RDONLY | O_BINARY);
if (fd == -1) { if (fd == -1) {
perror("open datafile"); perror("open datafile");
exit(1); exit(1);
...@@ -56,7 +56,7 @@ int main(int argc, char **argv) ...@@ -56,7 +56,7 @@ int main(int argc, char **argv)
strncpy(filename, datafile[i].filename, 12); strncpy(filename, datafile[i].filename, 12);
printf("Extracting %s ", filename); printf("Extracting %s ", filename);
outfd = open(filename, O_RDWR | O_CREAT, 0644); outfd = open(filename, O_RDWR | O_CREAT | O_BINARY, 0644);
if (!outfd) { if (!outfd) {
perror("cant open file"); perror("cant open file");
exit(1); exit(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment