summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorerdgeist <>2005-07-12 13:46:47 +0000
committererdgeist <>2005-07-12 13:46:47 +0000
commit88ba1d04480e5350476291aaa9a400dc571bbc75 (patch)
treefed494a726fbd09994668212c88ab3d4cce444fb /src
parentb1d066634b4ad459a58ea8cdf05aee42680ba2b2 (diff)
sync
Diffstat (limited to 'src')
-rw-r--r--src/backen.c4
-rw-r--r--src/decompress.c4
-rw-r--r--src/mystdlib.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/backen.c b/src/backen.c
index d97f743..434f3d5 100644
--- a/src/backen.c
+++ b/src/backen.c
@@ -56,7 +56,7 @@ int main( int argc, char **argv ) {
56 printf( "%s\t%s\t", streets[sid], end+1 ); 56 printf( "%s\t%s\t", streets[sid], end+1 );
57 end = lookup + 6 + sprintf( lookup+6, "%s\t%s", streets[sid], end + 1 ); 57 end = lookup + 6 + sprintf( lookup+6, "%s\t%s", streets[sid], end + 1 );
58 while( isalpha( (int)end[-1] )) *--end = 0; 58 while( isalpha( (int)end[-1] )) *--end = 0;
59 *++end = '\t'; *++end = 0; 59 *end++ = '\t'; *end = 0;
60 } else { 60 } else {
61 printf( "\t\t" ); lookup[6] = lookup[7] = '\t'; lookup[8] = 0; 61 printf( "\t\t" ); lookup[6] = lookup[7] = '\t'; lookup[8] = 0;
62 } 62 }
@@ -73,7 +73,7 @@ int main( int argc, char **argv ) {
73 break; 73 break;
74 case 7: 74 case 7:
75 memcpy( lookup, ".....\t", 6 ); 75 memcpy( lookup, ".....\t", 6 );
76 sprintf( lookup, "%s", maps[k]->addr+mapoffs[k] ); 76 snprintf( lookup, 5, "%s", maps[k]->addr+mapoffs[k] );
77 lookup[5] = '\t'; 77 lookup[5] = '\t';
78 default: 78 default:
79 printf( "%s\t", maps[k]->addr+mapoffs[k] ); 79 printf( "%s\t", maps[k]->addr+mapoffs[k] );
diff --git a/src/decompress.c b/src/decompress.c
index dea2bca..0efd82c 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -7,9 +7,9 @@
7#define HUGEBLOCK (1024*1024) 7#define HUGEBLOCK (1024*1024)
8 8
9int main(int argc, char **argv) { 9int main(int argc, char **argv) {
10// int infile = open("/Volumes/DasTelefonbuch/atb/phonebook.db", O_RDONLY); 10 int infile = open("/Volumes/DasTelefonbuch/atb/phonebook.db", O_RDONLY);
11 11
12 int infile = open( argv[1], O_RDONLY); 12// int infile = open( argv[1], O_RDONLY);
13 printf( "%i\n", infile ); 13 printf( "%i\n", infile );
14 14
15 unsigned const char xorkey [XORLEN] = "Just for Fun. Linus Torvalds."; 15 unsigned const char xorkey [XORLEN] = "Just for Fun. Linus Torvalds.";
diff --git a/src/mystdlib.c b/src/mystdlib.c
index 2deda22..9d73293 100644
--- a/src/mystdlib.c
+++ b/src/mystdlib.c
@@ -20,7 +20,7 @@ MAP map_file( char *filename, int readonly )
20 { 20 {
21 fstat( map->fh, &fstatus ); 21 fstat( map->fh, &fstatus );
22 if( ( map->addr = mmap( NULL, map->size = (size_t)fstatus.st_size, 22 if( ( map->addr = mmap( NULL, map->size = (size_t)fstatus.st_size,
23 PROT_READ | ( readonly ? 0 : PROT_WRITE), MAP_NOCORE | (readonly ? 0 : MAP_SHARED), map->fh, 0) ) == MAP_FAILED ) 23 PROT_READ | ( readonly ? 0 : PROT_WRITE), (readonly ? 0 : MAP_SHARED), map->fh, 0) ) == MAP_FAILED )
24 { 24 {
25 fprintf( stderr, "Mapping file '%s' failed\n", filename ); 25 fprintf( stderr, "Mapping file '%s' failed\n", filename );
26 close( map->fh ); free( map ); map = NULL; 26 close( map->fh ); free( map ); map = NULL;