This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Handle ld.so.conf the same in ld as in ldconfig


On Mon, Oct 04, 2004 at 06:30:50PM +0200, Jakub Jelinek wrote:
> 	* emultempl/elf32.em (gld${EMULATION_NAME}_ld_so_conf): New structure.
> 	(gld${EMULATION_NAME}_parse_ld_so_conf,
> 	gld${EMULATION_NAME}_parse_ld_so_conf_include): New functions.
> 	(gld${EMULATION_NAME}_check_ld_so_conf): Use them.

OK.

> +      newp = xmalloc (p - filename + 1 + strlen (pattern) + 1);
> +      memcpy (newp, filename, p - filename + 1);
> +      strcpy (newp + (p - filename + 1), pattern);

Here you might like to save the result of the strlen, and then use
memcpy rather than strcpy.

> +      /* Normally this would use getline(3), but we need to be portable.  */

This code is only used on native linux systems, so why not use getline?

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]