Skip to content

Commit

Permalink
bug fix in load filter (option -f)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahra committed Mar 8, 2022
1 parent 3c146d1 commit 468a990
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/smloadosm.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2011-2021 Bernhard R. Fischer, 4096R/8E24F29D <[email protected]>
/* Copyright 2011-2022 Bernhard R. Fischer, 4096R/8E24F29D <[email protected]>
*
* This file is part of Smrender.
*
Expand All @@ -15,10 +15,12 @@
* along with Smrender. If not, see <http://www.gnu.org/licenses/>.
*/

/*! This program reads an OSM/XML file and parses it into an object tree.
/*! \file smloadosm.c
* This program reads an OSM/XML file and parses it into an object tree.
* Originally it was written for smfilter and was reused and adapted.
*
* @author Bernhard R. Fischer
* \author Bernhard R. Fischer, <[email protected]>
* \date 2022/03/08
*/
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -159,7 +161,7 @@ static int update_stats(const osm_obj_t *o, struct dstats *ds)
{
case OSM_NODE:
update_node_stats((osm_node_t*) o, ds);
// intentionally there's no break
/* fall through */
case OSM_WAY:
case OSM_REL:
ds->cnt[o->type]++;
Expand Down Expand Up @@ -622,7 +624,7 @@ int read_osm_file(hpx_ctrl_t *ctl, bx_node_t **tree, const struct filter *fi, st

case OSM_REL:
for (int i = 0; i < ((osm_rel_t*) obj)->mem_cnt; i++)
if (get_object(((osm_rel_t*) obj)->mem[i].type, ((osm_rel_t*) obj)->mem[i].type) == NULL)
if (get_object(((osm_rel_t*) obj)->mem[i].type, ((osm_rel_t*) obj)->mem[i].id) == NULL)
{
memmove(&((osm_rel_t*) obj)->mem[i], &((osm_rel_t*) obj)->mem[i + 1],
(((osm_rel_t*) obj)->mem_cnt - i - 1) * sizeof(*((osm_rel_t*) obj)->mem));
Expand Down

0 comments on commit 468a990

Please sign in to comment.