Commit 6b2fe0fb by Craig Burley Committed by Dave Love

(G77_hostnm_0): Fix off-by-one error

that was trashing the byte just beyond the CHARACTER*(*)
argument.

From-SVN: r19427
parent a235cdd7
...@@ -39,7 +39,7 @@ integer G77_hostnm_0 (char *name, ftnlen Lname) ...@@ -39,7 +39,7 @@ integer G77_hostnm_0 (char *name, ftnlen Lname)
if (ret==0) { if (ret==0) {
/* Pad with blanks (assuming gethostname will make an error /* Pad with blanks (assuming gethostname will make an error
return if it can't fit in the null). */ return if it can't fit in the null). */
for (i=strlen(name); i<=Lname; i++) for (i=strlen(name); i<Lname; i++)
name[i] = ' '; name[i] = ' ';
} }
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment