summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-07-12 15:52:35 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-07-12 15:52:35 +0000
commit09ea257c585fd3f828052e25c4f05680914d345b (patch)
tree8945e370532e1bdf59ad4bc759a78a9efbd6da86 /c
parentchanged version to 19990709 (diff)
downloadrtems-09ea257c585fd3f828052e25c4f05680914d345b.tar.bz2
Patch from Eric Norum <eric@cls.usask.ca>:
I get the following warning when compiling the latest snapshot. I had a quick look at the source -- it certainly looks to me like this is a real bug. ../../../../src/rtems-19990709/c/src/lib/libc/mount.c:97: warning: `options' might be used uninitialized in this function Also, I changed the TFTP test program and TFTP driver to reflect the changes in the way paths are passed to the TFTP driver. The TFTP driver now needs a proper `dotted-decimal' hostname as the second component of the path name.
Diffstat (limited to 'c')
-rw-r--r--c/src/exec/libnetworking/lib/tftpDriver.c35
-rw-r--r--c/src/lib/libnetworking/lib/tftpDriver.c35
-rw-r--r--c/src/libnetworking/lib/tftpDriver.c35
3 files changed, 45 insertions, 60 deletions
diff --git a/c/src/exec/libnetworking/lib/tftpDriver.c b/c/src/exec/libnetworking/lib/tftpDriver.c
index d9995019f8..f91b89927f 100644
--- a/c/src/exec/libnetworking/lib/tftpDriver.c
+++ b/c/src/exec/libnetworking/lib/tftpDriver.c
@@ -430,35 +430,30 @@ int rtems_tftp_open(
char *remoteFilename;
rtems_interval now;
rtems_status_code sc;
+ char *hostname;
/*
* This came from the evaluate path.
*/
cp2 = iop->file_info;
- if (*cp2 == '/') {
- farAddress = rtems_bsdnet_bootp_server_address.s_addr;
+
+ cp1 = cp2;
+ while (*cp2 != '/') {
+ if (*cp2 == '\0')
+ return ENOENT;
+ cp2++;
}
- else {
- char *hostname;
-
- cp1 = cp2;
- while (*cp2 != '/') {
- if (*cp2 == '\0')
- return ENOENT;
- cp2++;
- }
- len = cp2 - cp1;
- hostname = malloc (len + 1);
- if (hostname == NULL)
- return ENOMEM;
+ len = cp2 - cp1;
+ hostname = malloc (len + 1);
+ if (hostname == NULL)
+ return ENOMEM;
- strncpy (hostname, cp1, len);
- hostname[len] = '\0';
- farAddress = inet_addr (hostname);
- free (hostname);
- }
+ strncpy (hostname, cp1, len);
+ hostname[len] = '\0';
+ farAddress = inet_addr (hostname);
+ free (hostname);
if ((farAddress == 0) || (farAddress == ~0))
return ENOENT;
diff --git a/c/src/lib/libnetworking/lib/tftpDriver.c b/c/src/lib/libnetworking/lib/tftpDriver.c
index d9995019f8..f91b89927f 100644
--- a/c/src/lib/libnetworking/lib/tftpDriver.c
+++ b/c/src/lib/libnetworking/lib/tftpDriver.c
@@ -430,35 +430,30 @@ int rtems_tftp_open(
char *remoteFilename;
rtems_interval now;
rtems_status_code sc;
+ char *hostname;
/*
* This came from the evaluate path.
*/
cp2 = iop->file_info;
- if (*cp2 == '/') {
- farAddress = rtems_bsdnet_bootp_server_address.s_addr;
+
+ cp1 = cp2;
+ while (*cp2 != '/') {
+ if (*cp2 == '\0')
+ return ENOENT;
+ cp2++;
}
- else {
- char *hostname;
-
- cp1 = cp2;
- while (*cp2 != '/') {
- if (*cp2 == '\0')
- return ENOENT;
- cp2++;
- }
- len = cp2 - cp1;
- hostname = malloc (len + 1);
- if (hostname == NULL)
- return ENOMEM;
+ len = cp2 - cp1;
+ hostname = malloc (len + 1);
+ if (hostname == NULL)
+ return ENOMEM;
- strncpy (hostname, cp1, len);
- hostname[len] = '\0';
- farAddress = inet_addr (hostname);
- free (hostname);
- }
+ strncpy (hostname, cp1, len);
+ hostname[len] = '\0';
+ farAddress = inet_addr (hostname);
+ free (hostname);
if ((farAddress == 0) || (farAddress == ~0))
return ENOENT;
diff --git a/c/src/libnetworking/lib/tftpDriver.c b/c/src/libnetworking/lib/tftpDriver.c
index d9995019f8..f91b89927f 100644
--- a/c/src/libnetworking/lib/tftpDriver.c
+++ b/c/src/libnetworking/lib/tftpDriver.c
@@ -430,35 +430,30 @@ int rtems_tftp_open(
char *remoteFilename;
rtems_interval now;
rtems_status_code sc;
+ char *hostname;
/*
* This came from the evaluate path.
*/
cp2 = iop->file_info;
- if (*cp2 == '/') {
- farAddress = rtems_bsdnet_bootp_server_address.s_addr;
+
+ cp1 = cp2;
+ while (*cp2 != '/') {
+ if (*cp2 == '\0')
+ return ENOENT;
+ cp2++;
}
- else {
- char *hostname;
-
- cp1 = cp2;
- while (*cp2 != '/') {
- if (*cp2 == '\0')
- return ENOENT;
- cp2++;
- }
- len = cp2 - cp1;
- hostname = malloc (len + 1);
- if (hostname == NULL)
- return ENOMEM;
+ len = cp2 - cp1;
+ hostname = malloc (len + 1);
+ if (hostname == NULL)
+ return ENOMEM;
- strncpy (hostname, cp1, len);
- hostname[len] = '\0';
- farAddress = inet_addr (hostname);
- free (hostname);
- }
+ strncpy (hostname, cp1, len);
+ hostname[len] = '\0';
+ farAddress = inet_addr (hostname);
+ free (hostname);
if ((farAddress == 0) || (farAddress == ~0))
return ENOENT;