[BACK]Return to kernfs_vnops.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / miscfs / kernfs

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/miscfs/kernfs/kernfs_vnops.c between version 1.5 and 1.6

version 1.5, 1993/04/27 07:21:37 version 1.6, 1993/04/27 10:06:10
Line 133  kernfs_xread(kt, buf, len, lenp)
Line 133  kernfs_xread(kt, buf, len, lenp)
                 char *cp = hostname;                  char *cp = hostname;
                 int xlen = hostnamelen;                  int xlen = hostnamelen;
   
                 if (xlen >= len)                  if (xlen + 2 > len)     /* extra space for null and newline */
                         return (EINVAL);                          return (EINVAL);
   
                 sprintf(buf, "%s\n", cp);                  bcopy(cp, buf, xlen);   /* safer than sprintf */
                   buf[xlen] = '\n';
                   buf[xlen+1] = '\0';
                 break;                  break;
         }          }
   
Line 167  kernfs_xwrite(kt, buf, len)
Line 169  kernfs_xwrite(kt, buf, len)
                 if (buf[len-1] == '\n')                  if (buf[len-1] == '\n')
                         --len;                          --len;
                 bcopy(buf, hostname, len);                  bcopy(buf, hostname, len);
                 hostnamelen = len - 1;                  /* kernfs_write set buf[value_passed_as_len] = \0.
                    * therefore, buf len (hostnamelen) = len.
                    */
                   hostnamelen = len;
                   hostname[hostnamelen] = '\0';   /* null end of string. */
                 return (0);                  return (0);
         }          }
   

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

CVSweb <webmaster@jp.NetBSD.org>