diff options
author | aj <aj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-15 08:25:52 +0000 |
---|---|---|
committer | aj <aj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-15 08:25:52 +0000 |
commit | 9ecc9c35b2c7f4320e7c0aa6acb39ba9fbd96329 (patch) | |
tree | 5c5e356ef64577e81376928db6d155510e4b04b5 /libgfortran/intrinsics/link.c | |
parent | a324cccc5065c0a26e802a06111dbb86c3173da4 (diff) | |
download | gcc-9ecc9c35b2c7f4320e7c0aa6acb39ba9fbd96329.tar.gz |
* intrinsics/chdir.c, intrinsics/getlog.c, intrinsics/link.c,
intrinsics/symlnk.c, intrinsics/perror.c: Include <string.h> for
prototypes.
* runtime/string.c (compare0): Remove unused variable.
* io/unit.c (init_units): Remove unused variables.
* intrinsics/getcwd.c (getcwd_i4_sub): Remove unused variable.
* intrinsics/unlink.c (unlink_i4_sub): Remove unused variable.
* intrinsics/stat.c (stat_i4_sub, fstat_i8_sub, fstat_i4_sub,
stat_i8_sub): Remove unused variable.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99716 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/intrinsics/link.c')
-rw-r--r-- | libgfortran/intrinsics/link.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libgfortran/intrinsics/link.c b/libgfortran/intrinsics/link.c index 33cf816b66e..8d131fef2b4 100644 --- a/libgfortran/intrinsics/link.c +++ b/libgfortran/intrinsics/link.c @@ -35,6 +35,9 @@ Boston, MA 02111-1307, USA. */ #include "../io/io.h" +#ifdef HAVE_STRING_H +#include <string.h> +#endif #ifdef HAVE_UNISTD_H #include <unistd.h> #endif @@ -64,15 +67,15 @@ link_i4_sub (char *path1, char *path2, GFC_INTEGER_4 *status, /* Make a null terminated copy of the strings. */ str1 = gfc_alloca (path1_len + 1); memcpy (str1, path1, path1_len); - str1[path1_len] = '\0'; + str1[path1_len] = '\0'; str2 = gfc_alloca (path2_len + 1); memcpy (str2, path2, path2_len); - str2[path2_len] = '\0'; + str2[path2_len] = '\0'; val = link (str1, str2); - if (status != NULL) + if (status != NULL) *status = (val == 0) ? 0 : errno; } iexport(link_i4_sub); @@ -97,15 +100,15 @@ link_i8_sub (char *path1, char *path2, GFC_INTEGER_8 *status, /* Make a null terminated copy of the strings. */ str1 = gfc_alloca (path1_len + 1); memcpy (str1, path1, path1_len); - str1[path1_len] = '\0'; + str1[path1_len] = '\0'; str2 = gfc_alloca (path2_len + 1); memcpy (str2, path2, path2_len); - str2[path2_len] = '\0'; + str2[path2_len] = '\0'; val = link (str1, str2); - if (status != NULL) + if (status != NULL) *status = (val == 0) ? 0 : errno; } iexport(link_i8_sub); |