Skip to content

Commit

Permalink
Ensure allocated path is long enough for pssolar (#8261)
Browse files Browse the repository at this point in the history
See GenericMappingTools/pygmt#2959 for background.  Ensure we add at least 1 point when going to pole.
  • Loading branch information
PaulWessel authored Jan 7, 2024
1 parent 9a7850e commit 6da8ee2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gmt_plot.c
Original file line number Diff line number Diff line change
Expand Up @@ -9704,7 +9704,7 @@ uint64_t gmt_geo_polarcap_segment (struct GMT_CTRL *GMT, struct GMT_DATASEGMENT
perim_n = gmtlib_lonpath (GMT, start_lon, pole_lat, yc, &x_perim, &y_perim);
GMT_Report (GMT->parent, GMT_MSG_DEBUG, "Created path from %g/%g to %g/%g [%d points]\n", start_lon, pole_lat, start_lon, yc, perim_n);
/* 2. Allocate enough space for new polar cap polygon */
n_new = 2 * perim_n + n;
n_new = 2 * MAX (perim_n, 1) + n;
plon = gmt_M_memory (GMT, NULL, n_new, double);
plat = gmt_M_memory (GMT, NULL, n_new, double);
/* Start off with the path from the pole to the crossing */
Expand Down

0 comments on commit 6da8ee2

Please sign in to comment.