libxml C fun

Billy O'Connor billyoc at linuxfromscratch.org
Mon Dec 2 07:59:23 PST 2002


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



More information about the alfs-discuss mailing list