ndbm problem

John F Haugh II jfh at rpp386.cactus.org
Sat Feb 9 00:11:58 AEST 1991


In article <5024 at lure.latrobe.edu.au> CCJMB at lure.latrobe.edu.au writes:
>	l am trying to build a database using ndbm functions, however the data
>l am storing contains nulls and when the data is stored in the db the nulls
>aren't, and hence the whole thing screws up !!
>
>	Does anyone have an answer ???

How are you determining the length of the buffer you are handing to
ndbm?  The two parts of the key/data are the pointer to the data and
the length of the data being pointed to.  It sounds as though you
might be passing in the wrong length, for example, if you are using
strlen() it would stop at the first NUL character.
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh at rpp386.cactus.org
"I've never written a device driver, but I have written a device driver manual"
                -- Robert Hartman, IDE Corp.



More information about the Comp.unix.questions mailing list