]> granicus.if.org Git - php/commitdiff
Verified and fixed bug 6852 #1. No more null byte after terminating 0x0D.
authorVlad Krupin <vlad@php.net>
Mon, 31 Dec 2001 09:13:08 +0000 (09:13 +0000)
committerVlad Krupin <vlad@php.net>
Mon, 31 Dec 2001 09:13:08 +0000 (09:13 +0000)
Verified that the problem is real when creating new files and writing
a record. Both fixed and old versions seem to be able to somehow read
and write already existing files properly though.
@Fixed bug 6852 #1. No more null byte after terminating 0x0D. (Vlad)

ext/dbase/dbase.c

index 78840d28751268508c3520526180def62098f439..8f7ab607035ded11f44cfa21cb9d0057f479a6bd 100644 (file)
@@ -684,7 +684,7 @@ PHP_FUNCTION(dbase_create)
        strcpy(dbh->db_date, "19930818");
        dbh->db_records = 0;
        dbh->db_nfields = num_fields;
-       dbh->db_hlen = sizeof(struct dbf_dhead) + 2 + num_fields * sizeof(struct dbf_dfield);
+       dbh->db_hlen = sizeof(struct dbf_dhead) + 1 + num_fields * sizeof(struct dbf_dfield);
 
        rlen = 1;
        /**