iliaa           Sat Feb 24 18:00:43 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/dbase  dbf_head.c dbf_rec.c 
  Log:
  
  strncpy() -> strlcpy()
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/dbase/dbf_head.c?r1=1.14.4.1.2.4&r2=1.14.4.1.2.5&diff_format=u
Index: php-src/ext/dbase/dbf_head.c
diff -u php-src/ext/dbase/dbf_head.c:1.14.4.1.2.4 
php-src/ext/dbase/dbf_head.c:1.14.4.1.2.5
--- php-src/ext/dbase/dbf_head.c:1.14.4.1.2.4   Sat Feb 24 02:17:24 2007
+++ php-src/ext/dbase/dbf_head.c        Sat Feb 24 18:00:43 2007
@@ -184,7 +184,7 @@
        /* build the on disk field info */
        scp = dbf->db_fname; dcp = dbfield.dbf_name;
 
-       strncpy(dbfield.dbf_name, dbf->db_fname, DBF_NAMELEN);
+       strlcpy(dbfield.dbf_name, dbf->db_fname, DBF_NAMELEN);
 
        dbfield.dbf_type = dbf->db_type;
        switch (dbf->db_type) {
http://cvs.php.net/viewvc.cgi/php-src/ext/dbase/dbf_rec.c?r1=1.10&r2=1.10.6.1&diff_format=u
Index: php-src/ext/dbase/dbf_rec.c
diff -u php-src/ext/dbase/dbf_rec.c:1.10 php-src/ext/dbase/dbf_rec.c:1.10.6.1
--- php-src/ext/dbase/dbf_rec.c:1.10    Thu Nov 27 10:15:20 2003
+++ php-src/ext/dbase/dbf_rec.c Sat Feb 24 18:00:43 2007
@@ -152,8 +152,7 @@
        if ( !cp )
                cp = (char *)malloc(flen + 1);
        if ( cp ) {
-               strncpy(cp, &rp[fldp->db_foffset], flen);
-               cp[flen] = 0;
+               strlcpy(cp, &rp[fldp->db_foffset], flen + 1);
        }
        return cp;
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to