Changeset 09ea257c in rtems


Ignore:
Timestamp:
07/12/99 15:52:35 (24 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
38e4a916
Parents:
8e4b4bd
Message:

Patch from Eric Norum <eric@…>:

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.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libnetworking/lib/tftpDriver.c

    r8e4b4bd r09ea257c  
    431431  rtems_interval      now;
    432432  rtems_status_code   sc;
     433  char               *hostname;
    433434
    434435  /*
     
    437438
    438439  cp2 = iop->file_info; 
    439   if (*cp2 == '/') {
    440     farAddress = rtems_bsdnet_bootp_server_address.s_addr;
     440
     441  cp1 = cp2;
     442  while (*cp2 != '/') {
     443    if (*cp2 == '\0')
     444      return ENOENT;
     445    cp2++;
    441446  }
    442   else {
    443     char *hostname;
    444 
    445     cp1 = cp2;
    446     while (*cp2 != '/') {
    447       if (*cp2 == '\0')
    448         return ENOENT;
    449       cp2++;
    450     }
    451 
    452     len = cp2 - cp1;
    453     hostname = malloc (len + 1);
    454     if (hostname == NULL)
    455       return ENOMEM;
    456 
    457     strncpy (hostname, cp1, len);
    458     hostname[len] = '\0';
    459     farAddress = inet_addr (hostname);
    460     free (hostname);
    461   }
     447
     448  len = cp2 - cp1;
     449  hostname = malloc (len + 1);
     450  if (hostname == NULL)
     451    return ENOMEM;
     452
     453  strncpy (hostname, cp1, len);
     454  hostname[len] = '\0';
     455  farAddress = inet_addr (hostname);
     456  free (hostname);
    462457
    463458  if ((farAddress == 0) || (farAddress == ~0))
  • c/src/lib/libnetworking/lib/tftpDriver.c

    r8e4b4bd r09ea257c  
    431431  rtems_interval      now;
    432432  rtems_status_code   sc;
     433  char               *hostname;
    433434
    434435  /*
     
    437438
    438439  cp2 = iop->file_info; 
    439   if (*cp2 == '/') {
    440     farAddress = rtems_bsdnet_bootp_server_address.s_addr;
     440
     441  cp1 = cp2;
     442  while (*cp2 != '/') {
     443    if (*cp2 == '\0')
     444      return ENOENT;
     445    cp2++;
    441446  }
    442   else {
    443     char *hostname;
    444 
    445     cp1 = cp2;
    446     while (*cp2 != '/') {
    447       if (*cp2 == '\0')
    448         return ENOENT;
    449       cp2++;
    450     }
    451 
    452     len = cp2 - cp1;
    453     hostname = malloc (len + 1);
    454     if (hostname == NULL)
    455       return ENOMEM;
    456 
    457     strncpy (hostname, cp1, len);
    458     hostname[len] = '\0';
    459     farAddress = inet_addr (hostname);
    460     free (hostname);
    461   }
     447
     448  len = cp2 - cp1;
     449  hostname = malloc (len + 1);
     450  if (hostname == NULL)
     451    return ENOMEM;
     452
     453  strncpy (hostname, cp1, len);
     454  hostname[len] = '\0';
     455  farAddress = inet_addr (hostname);
     456  free (hostname);
    462457
    463458  if ((farAddress == 0) || (farAddress == ~0))
  • c/src/libnetworking/lib/tftpDriver.c

    r8e4b4bd r09ea257c  
    431431  rtems_interval      now;
    432432  rtems_status_code   sc;
     433  char               *hostname;
    433434
    434435  /*
     
    437438
    438439  cp2 = iop->file_info; 
    439   if (*cp2 == '/') {
    440     farAddress = rtems_bsdnet_bootp_server_address.s_addr;
     440
     441  cp1 = cp2;
     442  while (*cp2 != '/') {
     443    if (*cp2 == '\0')
     444      return ENOENT;
     445    cp2++;
    441446  }
    442   else {
    443     char *hostname;
    444 
    445     cp1 = cp2;
    446     while (*cp2 != '/') {
    447       if (*cp2 == '\0')
    448         return ENOENT;
    449       cp2++;
    450     }
    451 
    452     len = cp2 - cp1;
    453     hostname = malloc (len + 1);
    454     if (hostname == NULL)
    455       return ENOMEM;
    456 
    457     strncpy (hostname, cp1, len);
    458     hostname[len] = '\0';
    459     farAddress = inet_addr (hostname);
    460     free (hostname);
    461   }
     447
     448  len = cp2 - cp1;
     449  hostname = malloc (len + 1);
     450  if (hostname == NULL)
     451    return ENOMEM;
     452
     453  strncpy (hostname, cp1, len);
     454  hostname[len] = '\0';
     455  farAddress = inet_addr (hostname);
     456  free (hostname);
    462457
    463458  if ((farAddress == 0) || (farAddress == ~0))
  • cpukit/libnetworking/lib/tftpDriver.c

    r8e4b4bd r09ea257c  
    431431  rtems_interval      now;
    432432  rtems_status_code   sc;
     433  char               *hostname;
    433434
    434435  /*
     
    437438
    438439  cp2 = iop->file_info; 
    439   if (*cp2 == '/') {
    440     farAddress = rtems_bsdnet_bootp_server_address.s_addr;
     440
     441  cp1 = cp2;
     442  while (*cp2 != '/') {
     443    if (*cp2 == '\0')
     444      return ENOENT;
     445    cp2++;
    441446  }
    442   else {
    443     char *hostname;
    444 
    445     cp1 = cp2;
    446     while (*cp2 != '/') {
    447       if (*cp2 == '\0')
    448         return ENOENT;
    449       cp2++;
    450     }
    451 
    452     len = cp2 - cp1;
    453     hostname = malloc (len + 1);
    454     if (hostname == NULL)
    455       return ENOMEM;
    456 
    457     strncpy (hostname, cp1, len);
    458     hostname[len] = '\0';
    459     farAddress = inet_addr (hostname);
    460     free (hostname);
    461   }
     447
     448  len = cp2 - cp1;
     449  hostname = malloc (len + 1);
     450  if (hostname == NULL)
     451    return ENOMEM;
     452
     453  strncpy (hostname, cp1, len);
     454  hostname[len] = '\0';
     455  farAddress = inet_addr (hostname);
     456  free (hostname);
    462457
    463458  if ((farAddress == 0) || (farAddress == ~0))
Note: See TracChangeset for help on using the changeset viewer.