diff --git a/gsw_check_functions.c b/gsw_check_functions.c index 843d04d..4b96423 100644 --- a/gsw_check_functions.c +++ b/gsw_check_functions.c @@ -538,9 +538,9 @@ report(char *funcname, char *varname, gsw_error_info *errs) if (strcmp(funcname, varname)) { msglen += 5; if (msglen > 62) { - k = strlen(varname) - (msglen - 62); + k = msglen - 62; strcat(message, " (.."); - strncat(message, varname, k); + strcat(message, varname+k); } else { strcat(message, " ("); strcat(message, varname); diff --git a/gsw_oceanographic_toolbox.c b/gsw_oceanographic_toolbox.c index eeee4c9..0ff106c 100644 --- a/gsw_oceanographic_toolbox.c +++ b/gsw_oceanographic_toolbox.c @@ -1,6 +1,6 @@ /* ** $Id: gsw_oceanographic_toolbox-head,v c61271a7810d 2016/08/19 20:04:03 fdelahoyde $ -** Version: 3.05.0-3 +** Version: 3 ** ** This is a translation of the original f90 source code into C ** by the Shipboard Technical Support Computing Resources group @@ -3923,8 +3923,13 @@ p_sequence(double p1, double p2, double max_dp_i, double *pseq, int *nps) if (nps != NULL) *nps = n; - for (i=1; i<=n; i++) - pseq[i-1] = p1+pstep*i; + /* + ! Generate the sequence ensuring that the value of p2 is exact to + ! avoid round-off issues, ie. don't do "pseq = p1+pstep*(i+1)". + */ + for (i=0; i 0) { /* deep */ for (i=0; i 0) { /* deep */ for (i=0; i