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] Allow multiple dlltools to be run concurrently in thesame directory


On Fri, 4 Jul 2003, Christopher Faylor wrote:
> Index: dlltool.c
> +prefix_encode PARAMS ((char *start, unsigned code))
>  {
> -  if (!buf)
> -    buf = malloc (strlen (tmp_prefix) + 17);
> -  sprintf (buf, fmt, tmp_prefix);
> +  static char alpha[] = "abcdefghijklmnopqrstuvwxyz";
> +  static char buf[32];
> +  char *p;
> +  strcpy (buf, start);
> +  p = strchr (buf, '\0');
> +  do
> +    *p++ = alpha[code % sizeof (alpha)];
> +  while ((code /= sizeof (alpha)) != 0);

I guess you want (sizeof (alpha) - 1) or strlen (alpha) or else
it seems PID n*26 gets a short prefix.

brgds, H-P


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