2 Dec 2002 16:59
Re: libxml C fun
Billy O'Connor <billyoc <at> linuxfromscratch.org>
2002-12-02 15:59:23 GMT
2002-12-02 15:59:23 GMT
mark.uzumati <at> virgin.net (Mark Ellis) writes:
> gcc -g -O2 -o simplealfs -static simplealfs-simplealfs.o -L/usr/lib
> /usr/lib/libxml2.a -lz -lpthread -lm ../libalfs/.libs/libalfs.a -ldl
>
>
> cut from simplealfs.c
>
> char *xml = NULL;
> xmlDocPtr xmldoc = NULL;
>
> /* reads a file and stores it all in a string */
> xml = read_profile(profile);
> if (xml == NULL) {
> return 0;
> }
>
> profile_len = strlen(xml)+1;
That +1, is that neccessary when you're getting the strlen()? That
looks like an edge condition.
Billy
--
--
Unsubscribe: send email to listar <at> linuxfromscratch.org
and put 'unsubscribe alfs-discuss' in the subject header of the message
RSS Feed