[Tile-serving] [osm2pgsql] Fix warnings when compiling tests, use -Werror with travis (#395)

Paul Norman notifications at github.com
Fri Jul 17 04:50:32 UTC 2015


> @@ -323,41 +323,41 @@ int middle_pgsql_t::local_nodes_set(const osmid_t& id, const double& lat,
>        char *buffer = (char *)alloca( length );
>  #ifdef FIXED_POINT
>        ramNode n(lon, lat);
> -      if( snprintf(buffer, length, "%" PRIdOSMID "\t%d\t%d\t%s\n",
> -                   id, n.int_lat(), n.int_lon(), tag_buf ) > (length-10) )
> -      { fprintf( stderr, "buffer overflow node id %" PRIdOSMID "\n", id); return 1; }
> +      if (snprintf(buffer, length, "%" PRIdOSMID "\t%d\t%d\t%s\n",
> +                   id, n.int_lat(), n.int_lon(), tag_buf ) > (length-10)) {
> +         throw std::runtime_error((boost::format("Buffer overflow node id %1%") % id).str());

This is a change from continuing to execute to exiting the program, but I've never seen this error occur.

I also thing the entire section should be rewritten to not C strings, but that should be a different PR.

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/395/files#r34862107
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150716/d1703d4f/attachment.html>


More information about the Tile-serving mailing list