(G77_hostnm_0): Fix off-by-one error
authorCraig Burley <burley@gnu.org>
Mon, 27 Apr 1998 10:11:57 +0000 (10:11 +0000)
committerDave Love <fx@gcc.gnu.org>
Mon, 27 Apr 1998 10:11:57 +0000 (10:11 +0000)
that was trashing the byte just beyond the CHARACTER*(*)
argument.

From-SVN: r19427

libf2c/libU77/hostnm_.c

index 8229e09e7277f742cd6c792858ecba28e12c252c..fd717b9f8572a0307c42f598d12fcb70d3534fc4 100644 (file)
@@ -39,7 +39,7 @@ integer G77_hostnm_0 (char *name, ftnlen Lname)
     if (ret==0) {
        /* Pad with blanks (assuming gethostname will make an error
            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] = ' ';
     }
     return ret;