Bug #1094

if statement condition in gmt_getdatapath() in gmt_io.c always satisfied?

Added by Masakazu 6 months ago. Updated 6 months ago.

Status:ClosedStart date:2017-05-12
Priority:NormalDue date:
Assignee:Paul% Done:

100%

Category:-
Target version:Candidate for next bugfix release
Affected version:5.x-svn Platform:

Description

Dear GMT developers,

When I looked into gmt_getdatapath() in gmt_io.c, I found that the following condition in the if-statement around source:trunk/src/gmt_io.c@18200#L4456 seems to be always satisfied, because there is ", 99" in it.

#ifdef HAVE_GDAL
                if (gmtlib_check_url_name ((char *)stem), 99)
                        return ((char *)stem);                        /* With GDAL all the /vsi-stuff is given existence credit */

I would appreciate if you could review the part.

Thank you,
Masakazu

Associated revisions

Revision 18273
Added by Paul 6 months ago

Address issue #1094

History

#1 Updated by Joaquim 6 months ago

  • Status changed from New to In Progress

Strange, I don't get it what might have been the intention of that 99 but it's there since that code chunk was introduced in r13744 to fix issue #649

#2 Updated by Paul 6 months ago

  • Status changed from In Progress to Resolved
  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 100

Fixed in r18274. An odd thing. Most likely I was trying to type ", 99" into another file but the mouse focus was on this file, and it just happen to land inside that if-test and not cause a syntax error (but a semantic error). Thanks for catching it!

#3 Updated by Masakazu 6 months ago

Thank you for fixing it.

#4 Updated by Paul 6 months ago

  • Status changed from Resolved to Closed

Closed as fixed.

Also available in: Atom PDF