summaryrefslogtreecommitdiff
path: root/src/export
diff options
context:
space:
mode:
Diffstat (limited to 'src/export')
-rw-r--r--src/export/map_coords.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/export/map_coords.c b/src/export/map_coords.c
index b46f1cf..93c858f 100644
--- a/src/export/map_coords.c
+++ b/src/export/map_coords.c
@@ -18,13 +18,14 @@ int qsort_cmp( const void *a, const void *b )
18 18
19int main( int argc, char ** args ) 19int main( int argc, char ** args )
20{ 20{
21 MAP coords = map_file( args[1], 1 ); 21 MAP coords;
22 int i, l, lines;
23 char *p, **offsets, *input = malloc(1024); 22 char *p, **offsets, *input = malloc(1024);
24 ssize_t ll; 23 ssize_t ll;
25 size_t input_length = 1024; 24 size_t i, l, lines, input_length = 1024;
26 25
27 if( !coords ) exit( 111 ); 26 if( argc != 2 ) { fprintf( stderr, "Syntax: printf %%s\\t%%s\\t%%s <zipcode> <streetname> <housenumber> | %s <coords_file>\n", args[0] ); exit(111); }
27 coords = map_file( args[1], 1 );
28 if( !coords || !input ) { fprintf( stderr, "Error allocating resources\n" );exit( 111 ); }
28 p = (char *)coords->addr; 29 p = (char *)coords->addr;
29 for ( i=0, lines=0; i<coords->size; ++i ) 30 for ( i=0, lines=0; i<coords->size; ++i )
30 if( p[i] == 0x00 ) 31 if( p[i] == 0x00 )